Check the crankshaft position sensor, sorry I am a car guy and don't know what else to call it. Mine failed and the symptoms were exactly like yours. It counts the teeth on the flywheel and makes sure the engine is turning over. If it is bad, it doesn't see the flywheel and shuts down the fuel pump, carb and coil.
It is the small single wire that goes under the shroud to the flywheel end. You can measure the ohm reading with a voltmeter. If it is zero ohms it is bad.
If yours is bad, unfortunately the only way to get to it is pull all the shrouds off the engine and that meant mine had to come out of the coach.
Forgot to mention, the wire can be disconnected in the circuit board box, if I remember correctly.
I bought the sensor online for about 30 bucks, but most mower shops have them.