The purpose of the battery is a) to act as a reserve and provide the shortfall when the alternator isn't providing enough power or b) to start the bike.
In most circumstances the alternator will be sufficient so I would be sceptical about your diagnosis.
#1 rule of diagnosis - don't guess and where possible measure so you are basing your diagnosis on fact.
A good start (which is really routine maintenance) would be to ensure that all of the earths are clean. It's also worthwhile breaking and re-making all of the relevant connectors in the headlight circuit.which will have the effect of cleaning them up.
If that is ineffective then you would need to get the multi-meter out.
Agree completely with MaxMidnight (known by his British Brethren as
Professor MaxMidnight:worthy
Electrical problems have to be approached systematically, eliminating possible cause(s) one at a time. A good multimeter is essential for a proper diagnosis to be done.
My vote for #2 rule of diagnosis - Start with the
simple things first, which Max suggests-checking all grounds and connectors. I would add checking the
headlight fuse/spring connectors as well. Any connection that is loose or corroded adds resistance to the circuit, cutting down available voltage.
Whether the above solves the problem or not, I would next check the voltage across the battery terminals at idle and as the bike is spooled up (stator maximum output is reached at 5K, but this is also a function of the type and condition of the regulator/rectifier) - then compare these readings to the voltage
directly at the headlight connection(black - ground, yellow - high beam, green - low beam, or as the Brits say, "dip").
It is normal to see reduced voltage, usually around 1/2 volt or so. Many folks install a
Headlight Relay Kit to alleviate this voltage loss, and to also protect the switches in the circuit.
Keep us informed as you check things out.
Cheers!