My understanding is that the benefit of being outdoors is the ability and opportunity to regularly focus on things at a distance that helps, so sunglasses wouldn't factor in.
It’s also exposure to natural light. Myopia jumps when kids are exposed to artificial lighting [1]. It seems some constant is hard coded into our genes to calibrate our eyes to the Sun’s light. (Artificial natural light, despite sounding like an oxymoron, can help.)
That was the leading theory for many years that explained why adult humans today have much worse vision that humans of the not-so-distant past, but it was disproven in the last decade.
We don't yet understand why, but lack of exposure to sunlight is what causes still-developing eyes to grow incorrectly.
The issue isn't brightness, it's distance to what you are looking at and focus on the retina. When your eyes can still bring far objects into focus, they produce a signal that causes your eyes to grow longer.
https://newsroom.uw.edu/news-releases/glasses-stop-myopia-ar...
The brightness of light is actually believed to be the main factor now. This seems a supported by animal studies, where animals are fitted with light-filtering goggles. Animals that receive brighter light develop normally, while animals that receive dimmer light develop myopia.
Do we really need VR headsets for this? Is there some material way in which just walking around outside, for free, is worse than strapping expensive electronics to your face and staying indoors?