1. It’s closer to 50 years, and even a partially degraded panel will work, just with less output
2. Even if we say 20 years, that means that you only need to buy panels once every 20 years! Not continuously. A complete and total interruption of solar panel production lasting 4 years will only mildly interrupt current output. How long can we last with a total disruption to oil supply chains?
The long operating life of a solar panel compared to a barrel of oil is a selling point when it comes to self-sufficiency. With 20 years of warning, any country that pretends to be a globally-relevant power can get itself to the point of producing acceptable solar panels if its survival depends on it.