I had a VW Rabbit years ago w/this exact symptom. To figure out the cause I sprayed water with a hose all over the engine from every direction and it would never stall. I think I could have driven it underwater and it would have run fine … lol . Then I’d drove over a medium sized puddle, kaput … engine stalls.
I ended up having to remove all the high voltage parts from the ignition system and inspect them on the bench under a bright light and magnifying glass. Sure enough I found a tiny crack on the underside of the ignition coil. Replaced, never had the problem again.