Once the engine is running on my 1995 mechanical diesel, removing electricity will not stop the engine.
I have to stop the fuel flow to kill the engine.
That is normally done by the fuel shutdown solenoid when electricity is removed by the ignition switch being turned to off.
I do get the occasional alternator alert when I turn off the ignition. I have not paid attention to that alert because I know the alternator is not spinning.
So, I would suspect your EPM, your engine oil sensor, or your coolant sensor could be shutting down the engine. I suspect the air filter could trigger a shutdown also.
Your floor override switch does override the EPM shutdown for enough time to pull the rig to the side of the road when a shutdown occurs.
If the chassis battery or alternator do not keep the transmission supplied with electricity, that does trigger the EPM safety shutdown, I kind of remember.
I have worked around that issue by jumping the chassis battery from the house battery while it is being charged by the generator. Then the alternator is not needed.
Another possibility is that the fuel shut down solenoid, if you have one, will not stay in the Run position once the engine is started.
Our fuel solenoid has three positions. Start, Run, and closed.
I have had to use a wire to hold the solenoid shaft in the start position to use the engine if the fuel solenoid is not working correctly. Then I have to release the wire to shut it down.
Ooops.. I should have read Rsponsford's reply before posting. He said it better than I did.
It sounds like you are getting closer to a solution.