Sounds like the cam/crank sensor to me. I had a similar issue a few years ago. P38 4.6 Thor. Car would start and run fine then when hot refuse to start until cooled and then cut out once on the road, got to the roadside refused to start called a tow truck and when he arrived it started fine...