In what measurement can you say that mining for rare materials (using child slave labor), toxic byproducts from solar/wind/battery manufacturing, and issues with disposing of damaged or worn components is still less damaging to the environment than using fossil fuels?
I am not an expert, so I posed your exact question to MS CoPilot AI and here is the interesting response I received along with some links. It might answer some of your questions. FWIW, I think we all should be concerned about potential negative aspects of adopting new technologies while still being open to potential better alternatives. I hope that makes sense. Anyways, for your consideration, here is a copy and paste of what MS CoPilot AI offered along with some links...
************************
That's a complex question! The environmental impact of different energy sources can be measured using
Life Cycle Assessment (LCA), which evaluates the environmental impacts from all stages of a product's life, from raw material extraction through materials processing, manufacture, distribution, use, repair and maintenance, and disposal or recycling.
While mining for rare materials, manufacturing solar panels, wind turbines, and batteries, and disposing of damaged components does have environmental impacts, studies generally show that the
cumulative environmental impact of renewable energy sources is significantly lower than that of fossil fuels over their entire life cycle. This includes factors like greenhouse gas emissions, air and water pollution, and resource depletion.
***************************
That first link is temporarily unavailable as I post this, but I included the link because it might be worth reading when it becomes available. The second link is a nice article that addresses many of your valid concerns. A picture is sometimes worth a thousand words, and I think the whole article is well worth reading, but check out this graph...

I appreciated your questions which lead me to some new research and knowledge on a cold, blowing snow, dead winter afternoon. Thank you.