My 97 BMW 528i seems to have lost all compression after only changing the spark plugs. The car was cranking and running fine until one day I drive down the street to a friends house, I turned the car off to speak with my neighbor, then come back and the car will not crank. It sounded like it wasn't getting any fuel, like maybe the fuel pump had gone out on it. So, we take it back home and get to the fuel pump and we do find that there is a loose wire, which we fix. We also went ahead and changed two relays in the trunk. Now, the car turns over and cranks and runs for about a minute, then cuts off again. So, at this point, we think, maybe we should check the plugs. Well the plugs were burnt looking so we change those out. Once we change those, we try to crank it and it sounds as if there is no compression. It doesn't make any sense. How does changing the spark plugs do that? Is there a special plug we should have used? It had Bosch in there and we also tried that with no luck.
A fuel pump will quit unexpectedly, and while a loose wire will cause that, the pump motor itself is more likely to be the cause of that. You won't have any pressure at the test port on the engine. You know changing the spark plugs is not the answer because all four, six, or eight of them are not going to foul at the same time. A bad plug will cause a misfire, possibly an intermittent one.
A more common cause of sudden stalling is a failing sensor. In particular camshaft position sensors and crankshaft position sensors often fail when they get hot, then work again when they cool down. This typically happens when restarting a hot engine that has been off for a few minutes. The heat has a chance to migrate up to the sensors when there's no natural air flow to cool them.
There really isn't much you can do to cause a sudden loss of compression. The best I can imagine is the timing belt was about to jump a tooth or break and you put in spark plus with too long a reach and locked up a piston. The problem with that theory is your engine uses a timing chain, not a belt. I'm more inclined to think you do not have a loss of compression, but some other symptom and cause. To be sure, use a compression tester to test one of the cylinders.
Check for spark too while a helper cranks the engine.