Recently, the French health authority warned that LEDs can permanently damage our eyes because of their blue light levels. Other studies also showed that blue light exposure from LEDs may increase the risk of age-related macular degeneration. https://www.dailymail.co.uk/health/article-7032303/LED-lights-irreversibly-damage-eyes-French-health-authority-warns.html
Interestingly, they didn't really compare LEDs with sunlight. Does that mean sunlight is safer even though it's much more intense?
In an office, you would expect the lighting level to be around 500 lux, and in sunlight, you can expect 1000 to 100,000 lux depending on the sun's angle and cloud over. My assumption is that sunlight would have more blue light for a given area.
If sunlight really is safer, I think it's because people protect their eyes in the sun because of the glare. They may squint, spend less time outside, wear sunglasses, or seek shades.