Check the transmission fluid level, if it's OK then I would have a diagnostic check performed on the transmission. There are so many possibilities, and only an inspection will determine what is going on here. Go to a shop that specializes in VW and/or transmission repair.
hows your shifter alignment? does r,n,d line up? the linkage could be off, not usually likely unless some work was done in this area. does the shift display light up when this happens? if so it stores a fault and can be diagnosed by a tester. should check for faults anyway.