Problems like this are hard to trace down. I will tell you that if you have an sohc cb, at idle, the lights dim as the alternator is not charging at that rpm, so the bike is running off battery.
If you have it, use your wiring diagram and trace the connections. A loose ground, worn through insulation are primary causes of this.
As a side note, I am going through something like this too.
One day, my signal lights would come on but not blink. Next day, no problem. Another day, no headlight. Next day, headlight works. Quite baffling
The ride IS the adventure. The destination is just to get gas!