Sounds like you have a faulty delay switch, sorry don't know the teck name for it.
It ist a switch of sorts, it is a (delay) relay.
The relay does not allow the headlight to turn on until energized.
The relay is energized with an output (one leg of) from the stator
, (w/engine running) energizing relay, allowing (turning on) power to your headlight.
Obviously, if your stator is is not 100 %...you have a problem.
To resolve your problem, I would check/re-solder/replace connectors (3 stator legs) as necessary concerned with Stator.
If the above does not resolve the problem
, replace the relay. I believe a replacement of the Junction Box
would resolve the defective relay problem.
Someone correct me if I am wrong.