First and most important, there should never be a fuel smell. That is a dangerous condition that should be identified and corrected.
The shore power / no shore power does not appear to correlate because of the reported engine cranking normally. If the additional power from the AC/DC battery charger on weak batteries was a factor, then the engine would crank slowly when away from the dock. Try killing shore power when arriving at the boat, long before starting to verify that isn't a factor.
Frequently proper cranking and fuel smell indicates an ignition problem. Most ignition problems are not also restart. For example if the coil fails when hot, it is also hot after the engine warms up. Poor electrical connections don't only happen after a stop.
One of the issues w/ boats like mine is heat soak vapor lock. Everything runs fine, shut down for an hour, the engine compartment temperature rises, then the engine won't restart because of fuel being vapor not liquid. Mercruiser now offers a low pressure fuel pump kit that purges the fuel vapor. I instead developed and installed a thermostatically controlled engine room heat extraction system that has 100% resolved the problem.
Try opening the engine compartment during the stop, to permit natural convection for heat removal during the stop to see if it prevents the restart problem, pointing at vapor lock.
A fuel pressure gauge connected to the fuel rail will show if vapor lock is the source during the problem.