And then you'd have to factor in the fact that basically none of the planet can be covered in solar panels
And then the fact that you wouldn't be able to efficiently transport the energy to where we need it
So yes in theory you put a couple hundred sqkm of solar panels in the Sahara and you're golden, in practice it's much more complex