Just a guess, but My brother had issues when he opened the gas cap while the car was running. Our mechanic suggested we always shut the car off before opening the gas cap. His car didn't refuse to start though.
Since the pressure is important, it would make sense that a loose, or old gas cap, might not seal correctly at times, or if it'* vented, it might not be venting correctly.
Check the cap, and replace if needed. If you're unsure, replace it for good measure.
Just a couple guesses....hope it helps..