All of those products sold as headlight restoration kits are going to work to some point but will not last. Some will last 3mo and some will last 12mo. But none are permanent. Even sanding, polishing and putting a film like XPEL on is really only mediocre at best as the films will start to yellow and degrade over time. Not that any repair will be "optically clear", but films aren't known for their clarity.
The only permanent solution is sanding and clear coating. I say permanent loosely, but I've done headlights in this fashion that have stayed crystal clear for over 5yrs. You MUST use a 2 part clear coat like Spraymax 2k Glamour or a 2 part clear sprayed out of a gun. Rustoleum 2x is NOT acceptable.
My process
-Remove headlights or mask of the front
-dry sand with 340 until all factory coating is gone and the surface is evenly scuffed
-wet sand 600 until uniform, wipe periodically to see your progress. I like to add 1-2 drops of Dawn into a 32oz spray bottle for a little lube.
-wet sand 800 until uniform
-clean surface with Isopropyl Alcohol or Automotive Wax & Grease remover. Inspect at this time for sanding uniformity.
-spray a light tack coat on the lenses and follow up with heavier coats following the Spraymax can's instructions until the can is almost empty. Do not worry about runs or orange peel at this time. Leave it alone!
-wet sand any imperfections with 1500 then 2500 and polish using a polisher and compound of your choice.
This process has worked for me several times. There is no need to sand any finer than 800 before applying clear coat. It needs the mechanical adhesion since plastic adhesion promotors can't be used and 1000 doesn't provide any difference in clarity. This is thicker and tougher than your paints clear coat.
https://www.amazon.com/SprayMax-Glamour-Gloss-Aerosol-Clear/dp/B0082LJMC6