Mine do the same at dusk and in tunnels or under trees.
This was pitch black at 23.45 and pretty unerving if it hadn't been on a lit section of motorway.
Reminds me of when I was 18 and had a brand new Honda 250RS. First night out I came thrapsing off a lit dual carriageway over the brow of a hill and downhill into a completely unlit section of twisty road. Flick high beam and oh sh*t main fuse to H.lights blew. Concentrates the mind riding at plenty mph down a twisty road in the pitch black I can tell you.
Took Honda three months to diagnose a short on the HB switch to the handlebar - by which time I had done the same thing three more times.

Fortunately I discovered that the pass switch still worked so I could hold it down until I came to a stop.
Twenty five years on and Honda are at it again!!