I'm not well versed in the idiosyncrasies of the Pathy, but what you describe sounds like an issue with fuel delivery. This could be due to pressure or vacuum build up from something not working properly in either your EVAP or Fuel Deliver system. I'd grab the Factory Service Manual (FSM) and start diagnosing the two systems, bit by bit. Fuel line and return line, FPR and it's vacuum line, pump, injectors, gas cap, EVAP lines, EVAP solenoids. Do you have the FSM? Sticky injectors might be able to be cleaned with an additive. You can check their resistance in Ohms to see if those are in spec. If it runs fine and starts fine the rest of the time, I don't think it's those very much, but maybe.
And / or, you can look for people with similar experience. I see one person who improved starts with a cleaned MAF, later they replaced their distributor and all was fixed. Older Pathy though.
1999-pathfinder-won-t-start-when-hot-t584772.html
Another person with a 1995 Pathy ended up just needing a new starter, even though it mostly started fine when cold.
Another person had a bad battery that wasn't all that obvious except during warm starts. They had that tested at the local AutoZone and then replaced it.
This thread had all kinds of potential issues, one being a thing called IPDM that needed to be replaced. I didn't follow it very well, but maybe there are clues for you to glean.
05-pathfinder-turns-over-but-won-t-start-t471365.html