Thinking somewhere in the safety switch area....but the no electric power for awhile makes that confusing too. Several times had to unplug the park brake switch to keep running. Would love to disengage every safety switch on it but dag gum they so interconnected!
Start at the battery. Remove and Clean BOTH ends of the cables and the terminals. Even if they "look good" clean them. Look for fuses. Remove any you find and look for any corrosion or heat damage. Do a general inspection of the wiring looking for anything melted or corroded connections.
Sounds like you are losing power to the machine and the fuel solenoid drops out killing the engine. Wires don't fail in the middle unless too much current through them. Problems are always at the ends of wires where they connect to something.