That's the fundamental problem that "right to repair" doesn't solve: new devices are turned out on production lines by robots and cheap labour (often in countries with lower wages than the target market) - repairs are labour-intensive, need to be done locally, and expensive (even when the makers don't gouge for parts) and look like poor value for money compared with getting a shiny new, latest model device.That doesnt sound very environmentally responsible!
If you want to be "environmentally friendly" make your device last for 5 years+ and put up with the cost of repairs (and learn not to drop it - they're actually pretty reliable). Or make "repairability" a bigger priority when buying new stuff.
"Right to repair" might have an indirect effect by encouraging makers to avoid some of the more blatant repair-hostile design choices - and some of the iFixit teardowns of recent Apple products do show a trend towards better repairability. The repair guides might also be useful for anybody who wants to start a repair business... but if we want easy to repair devices, that can be serviced with a couple of screwdrivers, we're going to have to wean ourselves off the sort of extreme thin & light designs we've become useful.
I'm sure that "Planned Obsolescence" is a factor, but the primary reason that we get glued-together devices, keyboards riveted into cases etc. is that screws take up more space and add more thickness. Want a detachable battery like the good old days? Well, you need space and weight for clips or hatches, and the battery needs its own rigid case (because people are going to carry them around loose)...
It's not that a repairable device has to be a brick - devices like the Framework laptop and some recent HP models show that you can make practical devices with easily replaceable parts - but they lack the sleekness of their less-fixable competitors and make other sacrifices (like no LPDDR RAM, and less battery capacity that could otherwise be crammed into the space).