I've only ever know it to be bad connections or bad earth on the rear lights themselves.
I remember years ago have this problem on a mk3 escort and no matter how much a cleaned up the connections it wouldn't cure it. I fitted new 'bulb holders'?? And soldered in new plug connectors and it was all fine