Rear flap lighting Q3

Hello, I have a Q3 bj 2016 with the following problem of lighting with closed tailgate lights only the lighting in the bumper. Have already changed the sensor in the area of the lock catcher. But the problem still exists. May it be that the problem lies on the tailgate lock. For a help in advance thank you. Greetings Wolfgang