Mining secures the ledger but it is also critical for continued processing of transactions. "Hey, we'll all wait until the next time we have an excess of renewable power to accept everybody's transactions" is... a mess.
Bitcoin mining is globally distributed and doesn’t come to a halt when a particular facility or even a whole region has to shutdown because excess energy is not available.