It depends. There might be more than one cause. First, try to replace the bulb and see what happens. If not, the wiring or the socket might suffer any corrosion. Check there, too. Also, check the faulty tail light switch. Maybe that one is causing you functioning issues.