If the headlight-motor continues to run in the up or down position or if the headlight lids will not rise or seem to rise erratically, this could mean, that the rolls in the motor are history.
For that case, you can repair that motor by replacing the three rolls.
One roll has a carving for rubber rings to make it more shock resistent.
I hope it works out for you.
Used prefs on my PRUSA mini:
The author hasn't provided the model origin yet.