When something like this 'all of a sudden' happens, you have to go back to basics, fuel, air, spark (I'm a diesel guy, I HATE spark!).
You know it has fuel, you do need to know if it's getting it to the carb (I'm a diesel guy, I HATE carb!).
There's little way to shut down your air, and no precedent likely.
Now to the likely culprit, spark. The ignition system causes your spark system to ground out which is how you stop it when you're done. likely OK, but worth a quick peak and 'wiggle' of the key to make sure it's not wiggling itself to the off position.
Much more likely to be a safety of some sort, and there are several on mowers. Seat safety - if it thinks you left the mower, it will shut down, generally in series with a safety attached to the way you turn the mower on to MOW. You can have safeties on your brake. There are myriad possibilities depending on your particular mower, best to start with a wiring diagram and check them all.
I had a seat safety once that appeared very slightly rusted when you looked at it that acted just that way, it would work for awhile, shut the system down, reset itself and all was fine, drive you nuts. You can short them all out, one at a time, to find the culprit, but you have to find them first, often in finding them you can see one that it just slightly off, and you may have just identified your offender.
Or, make sure your feet are tough enough for the dance, and prepare your youngest daughter!!! :laughing:
George