Does it restart right away every time or just sometimes or...?
Time for the Wiggle Test.
If it cranks but doesn't start right away , can you hear the fuel pump prime when the switch is turned to ON?
-If no pump noise, with key ON ,wiggle hard all the cables and harness connectors near the electric fuel pump and it's relay and fuse on top of the engine to see if the pump activates briefly.
-If you can hear the pump, with key held to Start still wiggle all the harness wires and connectors and relays and fuse holders on the engine and see if you can get it to fire.
On the other hand, if you don't have any trouble starting it right back up , leave it running and do the Wiggle Test to see if you can get it to cut off at the dock. Engine 1st, then include wires on the ign switch, lanyard switch and battery cables & grounds, etc.
If any Wiggling is successful the problem is very close to what you were touching.
One of my MPI's
had an occasional annoying brief cutout issue when cruising along for 2 yrs . Nothing ever showed on my marine diagnostic scanners.
Finally, the Wiggle Test led to a connector to the fuel pump relay which had 1 very slightly bent pin - hard to tell it wasn't straight. When straightened , no more problems of that nature for the past 8 yrs, ...though the fuel pump on engine 20 amp spade fuse has blown at start a couple times over the years since( 30 seconds to replace.)
Both the fuel pump and ECM/ECU have on-engine fuses that could have slightly iffy connections though other connectors are more likely. Don't neglect checking on-engine grounds as well . There are several at least.