WELCOME to LMF...
You say it has fuel & spark...
For it to die it must lose one of those...
If the PTO switch was not functioning you should not be able to start it...
Unplug the kill wire from the magneto, then if it still dies, I would look to fuel delivery problem... :smile:KennyV
If this is an older external coil engine... It will have no kill wire, there is no magneto...
In this case it is shut off by removing 12 volts from the coil using the key switch... & that is where I would suspect the problem is... Your loosing 12 volts either to the key switch OR in the key switch....