Check the residual fuel pressure when the engine is turned off (and hot). Pressure should remain in the system otherwise this will happen. You may also be having a relay problem where the relay will not operate when hot. It could be OK while driving but not when trying to activate it when hot.
Any relay in general, not pointing to a specific relay. You'll need to determine if the fuel or ignition system is not working, then see if there is a relay that controls those circuits and see if the relay is functioning properly.