Occasionally cranks but won’t start

Very weird, intermittent issue. Twice now, 4 months apart, after driving a short distance then leaving the car for a few hours, it refuses to start. Pressing ignition leads to long crank and either no start, or a weak, sputtering start then engine dies. First time, mechanic replaced fuel pump, but problem persisted. He towed it to another mechanic who almost accidentally got it started (possibly by adding a ground), but he couldn’t recreate the issue to diagnose. 4 months later, problem returned, but after towing the car to the mechanic (and sitting overnight), car started right up. Codes after last no-start were P062F, P069E, and P023F.

Tester