Adaptive headlights also usually include a self-levelling function that would resolve this issue.
It would be a simple mechanism, to self-level headlights. A hinge, dampers of some sort, and a weight hanging at the appropriate position to keep them level.
Dampers so that if you’re driving up and down hills, they don’t make a drastic, sudden shift to a new position.
Of course, they wouldn’t use something so simple - anything that can be done mechanically can be done for a larger profit using sophisticated electronics.
I agree, and especially on load-carrying vehicles that tow, carry a load sometimes, that are prone to having their level changed drastically in normal use, self-leveling would be very helpful.