Join Date: May 2013
Location: Left Coast, Canada
My similar problem was connections in the headlight being loose due to the difference between the stock and after market HID lights. I ended up having to zip-tie them together to keep the connection tight.
With the headlight on check/wiggle/tug all connections and switches. Disconnect all the plugs when you're checking and look for corrosion. Clean up any you find and put a thin coat of dielectric grease on all of them before reassembling.
Another source of similar problems is the main power. Degraded connections (loose or corroded) can create a voltage drop elsewhere in the circuit or draw high amounts to supply the battery. Without an on-board amp/voltage meter like in a car your only indication on a bike that power is being used up elsewhere is your headlight dims or goes out. Remove, clean and reconnect your main power and ground connections (battery, regulator, main fuse). That is something I do in my routine every spring before riding season.
If the problem continues I'd be suspecting the regulator is failing and power is being disrupted as it heats up.
Hopefully some simple cleaning will clear up the problem. This is simple stuff but there's nothing worse than intermittent electrical problems and all get found eventually.
Not all those who wander are lost.