The strategy agreed upon today was a revision of an earlier plan that would have cost a "mere" 5bn euro. This deal was however opposed by the individual federal states of Germany, which demanded 60bn – just to put the final 40bn in perspective.
40bn is still a huge sum of money (about 1/3 Jeff Bezos, for scale), but as a German voter and tax payer I have to say that I am entirely fine with this. Germany is a very prosperous country, and we have to get away from coal, the sooner the better. True, it probably could have been done with less money, but to me 40bn is still a favorable deal over no deal at all.
It seems like the opposite is true: Every year you wait, the upfront and recurring costs drop.
Unless you have a serious near-term problem arising from the status quo (e.g. stagnant air filled with coal exhaust), and that problem can be solved altogether at a tolerable cost, there is no advantage to moving first or early.
Happened over the last years often in cooperation with cities, which now have the problem of being stuck with polluting coal power stations that are not even profitable anymore. Contracts are often laid out in a manner that the cities have to shoulder the load. My sympathy is limited, they could have listened to the advocates of green energy who predicted that.
Anyway, deconstructing those new coal power stations and trying to help the affected cities and regions would raise the price of moving to green energy later. I'm not sure that would be completely offset by the lower prices and technological improvements one can expect to see each year.