I have found when that happened on mine that one of the metal rails in the taillight housing that the bulb sockets sit in worked itself loose over time and caused intermittent operation.
Although it looked fine visually, I ended up pressing along the rail until the indicator light went out. Then I firmly pressed it down on that area to resecure it to its original position.
A few weeks later, I broke the taillight lens when I backed into a pickup truck, so a new taillight assembly completely solved the problem.
2009 ML350 (84K) - Family vehicle
2001 CLK430 Cabriolet (71K) - Wife's car
2005 BMW 645CI (124K) - My daily driver
2012 Mustang V6 (60K) - Daughter's car