in my case it was the thermal contact switch within the headlight switch. I burnished the contacts and it worked again, but I lost confidence in it and replaced it with a new one.
don