Check the wire connection to the fuel cutoff solenoid on the injector pump. There is a single wire going to the solenoid. If I had a closeup pic of this area of the injector pump, I'd post it. Unfortunately, I don't have a pic.
The fuel cutoff solenoid is used to shut off fuel to the final stage of the injector pump to shut down the engine. When the engine is "on", there is +12V applied to the solenoid. When the engine is "off", there is 0V applied to the solenoid. The single wire supplies +12V to the solenoid. The electrical return path is the body of the pump and the engine ("ground").
The hardware securing the wire to the solenoid may be loose. It's real easy to check it and tighten if necessary.
The solenoid itself may be failing if the connection checks out OK. These solenoids are very reliable but some have failed. The solenoid is supposedly the same part that has been used on nearly all VW Diesels going back to the old VW Rabbit Diesels of the late 70's. It's actually a Bosch part.
There have also been a few failures where the O-ring gasket moves out of place and causes the solenoid to stick in the open or closed position (not an electrical problem). Since yours threw a code saying there's a intermittent electrical connection, check the wire connection to the solenoid.
Maybe someone else can chime in and post a pic of the pump and point to the fuel cutoff solenoid.
Just my $0.02 worth. Hope this information helps.
~ n1das
Black 2002 Golf GLS TDI 5-speed
86k miles and climbing!