Hi Jason...welcome to the Forum
It's usually water ingress on the VAG cars leaking onto the latch microswitch....you need to sort the leak and clean out the electrics.
Worth also checking the wiring into the tailgate but I haven't known it to happen on VAG, every other car though, lol
Cheers Trevor