This is what I was getting at. I had almost the same identical issue in my 2000 5.9L where it would just randomly die. I picked out a dry day, started it then took a water bottle and sprayed the distributor, wires, etc and it shut off. Wouldn’t start back up again until it dried.