I would suggest checking/testing the headlight relays.
Since it is an intermittent problem, I believe it should be caused by a loose or bad connection. The power supply for the taillights, instrument clusters etc get it power supply from the Fuse block # XXXXX , Red/Blue wire. I would suggets checking the fuse block for bad/overheated connections.
Lets go to diagnosis at the HeadLight switch.
1. Check for power supply to Pink/Black and Pink wire. If power is available, ground them and if headlight works, you need to check the switch grounding. If ok, the switch is bad.
2. Check for power supply to Red/Blue wire. If power is available and if you bridge it to the Green/Red wire, the taillights and illumination lights should work. If yes, the switch is bad.
Lets start with this first.
It is possible for the relays to be related to the problem.
The only thing the low beams and taillights have in common is the switch.
At switch, attach a wire to Pink or Pink/black and ground it to any body location. Does the headlight works or relay clicks? If yes you need to check the switch, it has bad contact internally or the ground (earth) wire connection is bad.