You don't say which HID headlights you have...if I make the assumption that you have the adaptive bi-xenon headlighhts (option s524a)...and not just the regular HID (xenon) headlights (option s522a)....there's a module (3
#5 in the diagram below) that can cause intermittent lighting issues like you describe.
If you have diagnostic equipment (software/hardware)...you'd see some indication of faults with the ALC module. I think it (ALC) stands for either automatic or adaptive light module. If you don't have any way to diagnose or communcate with the vehicle...you can try swapping this module to see if the problem follows it to the other side.