Two or three possible issues.
First the strange action of the temp gauge.. Hook up a volt meter and you will see the voltage drop when you turn on the lights.. The TEMP gauge is a "Fail Safe" Gauge. that means if it looses power, or if the wire to the sensor breaks, it goes to FULL SCALE (Thus alerting you to a problem).. The fuel gauge, You might have noticed, doing the opposite (Going down) as that's it's "Safe" fail mode.
A poor connection can cause a high voltage loss so what was 12 can become 10, or 8 or 6 or less
A slipping alternator drive belt can cause the alternator to spin just fast enough to turn the idiot light off, but not provide power for the headlights, this is epically true if it has "V" belts instead of the more modern serpentine belt.
And a failed alternator.. Likewise may not deliver the amps needed.
Home was where I park it. but alas the.
2005 Damon Intruder 377 Alas declared a total loss
after a semi "nicked" it. Still have the radios
Kenwood TS-2000, ICOM ID-5100, ID-51A+2, ID-880 REF030C most times