My Pontiac Grand Prix 1999 would stall intermittently, then it became more frequent until it just would not run or start at all.
First: This was the solution… Replace the MAF sensor, somehow it would not show an engine code, the car would crank OK, try to start, but after a few seconds would die. Plenty of gray and black smoke coming out of the exhaust.
As soon as I unplugged the connector to the MAF sensor, the car would run just fine.
Replaced the MAF sensor, car was fixed.
Before that I had replaced the ignition control module, crank sensor, checked timing gears, replaced idle control valve, as I read that any of those could be the issue.
I did almost an entire engine rebuilt with no luck.
Finally checked all signals to the ICU, ECU, voltages, ground to engine block, also removed and inspected fuel pump, checked fuel pressure and found it OK, spark plugs brand new, spark plug cables brand new, all coils produced spark, but car would not ignite, just crank, try to start then would die in a few seconds.
If your car ever dies in the middle of the road, cranks and tries to run but dies, try unplugging the connector to the MAF sensor located closest to the air intake hose, but attached to the throttle body, if the car runs fine, just drive it home, it may run a little rough, but will get you home, then just replace the MAF sensor so the computer will have the correct input to regulate fuel delivery to the cylinders.