(The 500 years question has issues for all the other sources of energy as well!)
The resource extraction issue is more than these are so useful we're going to build an ever growing amount of them.
Luckily they're made from widely available materials, with even more widely available substitutions possible e.g sodium batteries.
I don't see it being meaningfully more expensive to process smashed up old PV or batteries than starting from the natural state, and my expectation is that it would be easier.
The exception would be if some of the chemical pathways turn into low-concentration atmospheric gasses that then diffuse all over the world, which is how we got the problem with CO2 (and unrelated problems with CFCs).
https://www.epa.gov/facts-and-figures-about-materials-waste-...