My beetle is having this same issue. Replaced the fuel pump. 3 times, as well as a relay. Still the same issue...and she cuts off when I open her driver's side door.
After replacing the fuel pump, she started , no problem. I drove around for the day with no issues. Got home at day's end, woke up in the morning and no start. After the 3rd fuel pump replacement, I made a kill switch running from the fuse panel, to starve the pump of power while she sat for a duration.
Temporary as it is, it solved the problem. Still she would cut off when you open the door. Once I accidentally forgot to turn the switch off overnight, and she wouldn't start. I turned the switch on and let her sit for the day....she fired right up.
my conclusion is that the problem lies within the door switch. Oh, and my alarm arms itself intermittently. I'll turn the key to lock the door, and maybe the alarm will arm itself- sometimes it does, sometimes it doesn't. The solder within the door switch's contact posts, deteriorate, causing poor contact (poor quality solder), resulting in an open circuit to the fuel pump, causing the pump so shut down- an overheat failsafe I guess. what's causing this shut down the door opens, I don't know...the immobilizer maybe??? All I know is that the problem seems to lie within the door switch.
I'll be grabbing a door switch out of a salvage beetle this weekend.