Had a similar issue a few days ago but only with one of the headlights. That was caused by a corroded levelling motor connector. As your issue seems to affect both headlights it could be down to something else but still worth checking. Do your lights go through the test cycle of lowering and raising when you switch them on?