One problem is the manufacturers have made headlights into assemblies that cannot be repaired or really disassembled, forcing you to replace the entire thing if anything goes wrong. Also they can be expensive.
https://daxstreet.com/cars/419253/10-cars-where-a-headlight-assembly-costs-2000-dollars/
Also sometimes the new headlight needs to be programmed by the dealership to work correctly