2005 Ford Explorer Fuel Problems?

My 2005 Explorer starts and runs fine BUT…
Run it for an hour and shut it off it will start for a split second and shut off almost as if it had a bad key chip.
Kept trying it and every 5 min it will run just a little bit better. Until it runs fin.
I can drive it for 2 hours and everything is fine. Its only when I shut it off I have this problem
I have Replaced…
Fuel Pump
Mass Air Flow Sensor

Catylitic convertor could do this if its plugged up

Try pressing the throttle fully just as you turn off the ignition, so the engine gets the maximum air possible as it winds down. It does not need to rev, just purge the engine of fumes.

If that allows it to start normally, just get in to the habit of doing that as you turn it off.

Another possibility is that engine heat is building up after you stop and there's no airflow, causing a vapour lock in the fuel lines.

Try opening the bonnet/hood immediately you stop and see if it then starts OK when heat can escape.

I'm not sure what the cure would be for that one?
Should an electric fan run on for a while after the engine is stopped & that is no longer working correctly?

Fuel filter?

Check for trouble codes with a scan tool. After shutting off, check the temp sensor data with a scan tool. Temp sensor could be faulty. Crank sensor can also be bad when it is hot. It can also be a bad ignition switch.

No codes, check for spark and fuel pressure when starting after shutting off. Check if the injectors are firing or getting command to fire. No spark and no command to the injectors, the crank sensor is likely bad or a bad PCM relay.

FIND the fault why it is not starting.