As Tim mentioned, this really sounds like a classic "thermal failure" where a component fails when it heats up.
The problem with "testing" for a thermal failure is this. Unless you are quick with a meter, by the time you end up testing a sensor or if you test it in the driveway cold, it will probably test out just fine because it is NOT HOT any longer. That makes isolating thermal failures tough sledding. I'd still recommend testing though if you can make the arrangements to do so immediately upon failure.
My first instinct is that you may have a bad crankshaft position sensor. In my opinion, it is THE most common sensor failure on the Jeep 4.0 I've included a procedure for testing if you're so inclined.
I'm not a big fan at all of the strategy of "throwing parts at it" but in this unique situation, if you don't stumble onto the problem, installing a new crank sensor may be a good strategy. As they are such a common failure, even if it doesn't fix your problem, it's not money wasted.
BTW, "most" people replace the entire fuel pump assembly (pump/regulator/filter) on this vintage as the gas tank has to come down but I believe it can be repaired individually but for obvious reasons, consider doing the entire assembly.
Good luck and post back what you find!
Crankshaft Position Sensor: Common Symptoms if bad:
*Both the fuel gauge and or voltage gauge may not work/display
*It is possible that you may see a No Bus on the odometer
*You will have no spark. Fuel pressure may check okay but fuel won’t get to injectors
*Sometimes the OBDII code reader has trouble connecting to /reading codes
*Crank sensors can be intermittent; "thermal failure" is pretty common. Means that the sensor fails when engine gets hot, but works again when cooled back down. Be aware of this when testing as if you have a sensor that suffers from thermal failure, it will probably test GOOD as soon as it cools down.
---------------------------------------------------------------------------
CPS TESTING PROCEDURE 1991 – 2001 4.0L H.O. engines
1. Near the rear of intake manifold, disconnect sensor pigtail harness connector from main wiring harness.
2. Place an ohmmeter across terminals B and C (A-B-C) looking into connector left to right with the part with the notch in the middle on the right) Ohmmeter should be set to 1K-to-1OK scale for this test.
3. The meter reading should be open (infinite resistance). Replace sensor if a low resistance is indicated.