It has been a problem with my headlight lens's for a few years. Its the polycarbonate lens, which suffers from UV. From the factory they come coated in a UV proof lacquer. The lacquer wears off and becomes part of the problem, so you need to cut the lens back to bare polycarbonate then reseal it with lacquer. Just cutting it back without the sealer will only last for weeks - I know, I have gone through the process lots of times.
Polycarbonate is tough, but it is very susceptible to UV damage.
The original lacquer is probably thicker than you imagine and it all needs to be cut back. The best way is using wet and dry, in various grades, finishing with 1200, which should leave it matt. It then needs to be polished to clear with Autosol, Brasso, toothpaste, jewellers rouge, or any fine none waxy abrasive.
Don't try to polish with a machine, if the pad/ wet & dry is dry, the polycarbonate will be melted, it's easy by hand.
Finally, once the lens is sparkling clear and like new, needs protecting immediately from the UV. You can buy UV proof lacquer suggested to be specially made for headlights, but I had some normal car body paint protection lacquer - so I tested that under extreme conditions. I polished up and sprayed a scrap lens, which I left directly exposed to the sun out in my garden since a year last May. It worked, there was no discolouration, so I then did my car's headlights with it and there has been no problem since then.