Keeping coal plants around is cheap to cover that. Longer term things like producing ammonia during summer and converting it to electricity in fuel cells will allow to remove needs for fossil fuels completely.

I’d keep gas plants around, but anyway, you need to cover that case and can’t just handwave it away.

The main advantage of gas plants is that they support variability. In a world with enough battery storage to last for days that would be irrelevant. And as an insurance against rare events it is better to keep coal plants as transportation and storage of coal is vastly more resilient to interruptions.

Gas turbines can also run on synthetic methane or hydrogen, which is nice.