Grohnde (1984), Gundremmingen C (1967) and Brokdorf (1986), are old and due for closure (or in some cases long overdue). Construction of these plants began 50-60 years ago and some already have a history of accidents. (Unit A at Gundremmingen killed two workers and suffered major faults.)
These units each cost tens of millions in maintenance every year, and are just not cost effective for the operators.
Their combined output of ~4 GW is easily replaced by the 5 GW of new renewable energy capacity coming online. And the pace of new renewables is still rising.
Nuclear only accounts for ~12% of electricity generation and taking some of that offline (because the plants were designed a generation ago) is not drastically altering the mix and is easily compensated for with new renewables.
Germany's energy prices are high due to taxes and levies, not because a few old nuclear plants are being phased out.
Also, at this rate Germany will not "rely on generation from costly gas and coal for another 20 years". Renewables jumped from 6% of generation in 2000 to 50% today, and will make up the bulk of generation this decade as official targets are for 80% by 2030. And official targets tend to be pessimistic.
The other aspect people tend to miss in this conversation is demand, which has been dropping since 2010 and is projected to drop significantly (25%) by 2050.
Relatively small losses in nuclear generated electricity generation over time are more than compensated for by the much larger, rapid increases in new renewable capacity. All of which is further balanced out by dropping demand.
The temporary problem this winter is partially due to a demand bounce, but mostly thanks to rising gas/oil prices. The solution to which is keep adding renewables and reducing reliance on gas - it is not to keep a few potentially dangerous and very expensive ancient nuclear plants around.