had a similar issue. At least in my case it turned out to be a bad connection of the pcb connectors
inside the tail light. Cutting it open and sealing it was not the most pleasant work, but I got it working again - at least till now
Check out this thread:
https://f87.bimmerpost.com/forums/sh...925029&page=11