Assuming that the two other brake lights are working, Check the wiring loom in the boot for breaks. In the area where It goes from the body of the car to the boot lid. ( by the passenger side hinge)
It’s known as the ‘ loom of doom’ and causes quite a lot of problems.
You could also remove the cover panel and check there is no corrosion and Also check all the bulbs to make sure all are ok.