... Another thing to check is the fuel pump relay under the hood. They get crispy and corroded after while.
I remember a guy whose car would die spontaneously out of nowhere and had it looked at and everything tested fine but it still kept happening.
He was on the verge of getting rid of the car.
It was a safety issue.
Finally, the mechanics fully warmed up the car and found that the fuel pump relay would only fail when the car was hot.
They replace the fuel pump relay and his car was fixed.