The crank sensor, the coil & most sensors are packed in hard epoxy resin. When it is all totally cooled off, if it starts right up then poops out after warming up, then consider that anything with a hairline crack where you cant see it may spread open as it expands with heat causing it to run no more, then after it cools off & contracts again, the connections are back to where they need to be to fire off allowing it to start & run. This is really common on GM coil packs - they can bench test fine while cool, but get warm on the engine causing this exact issue. The PCM would be the last thing I would suspect. Crank sensor & ignition coil are my 2 top choices for the real issue.