I've had this problem too in my 02 Golf. In my case the solenoid actuator worked fine, the lock assembly was fine, but still it was difficult to open the rear hatch and sometimes impossible to get it to latch when closed.
To open the hatch, I had to activate it using the switch inside the car and then put the key in the lock and turn it all the way around to get it to finally open. Closing the hatch and getting it to lock again afterwards was hit or miss...mostly miss.
Slamming the hatch down hard also didn't help.
I finally pulled the latch cover off after uttering much profanity and studied the design. I found my problems were due to the lever or link between the lock mechanism and handle wasn't moving freely. This lever or "teeter totter" piece was binding up where it pivots. When this piece can't pivot freely, everything else gets stuck too. Mine was stuck badly enough that it was difficult to move by hand. Lubing it helped a lot and solved the problem. I need to pull it apart again and get some fresh lube in there because it's getting sticky again.
This seems to be fairly common in older Golfs. I'll take some hi-res pics and post 'em after I get in there again.
Good luck.