The CDU was in power when they proposed the timelines that ended up in the closures we saw recently, but the electoral success of the Green Party in that election cycle was a key factor. Your summary is disingenuous.
The original dissolution was passed as a plan during Schröder's first term, aka in the SPD/Green government, in 2002. Later, in 2010, the CDU/FDP government modified the plan and gave the power plant providers more budget. About half a year after this law has passed the Bundestag, the Fukushima nuclear power plant accident happened and a commission was established to study the security of nuclear power. Then, yes, CDU and FDP agreed upon a new plan to exit nuclear power earlier than their original extension planned, and some power plants were turned off right away.
You can point your finger at the CDU, but saying that the CDU was the big driving force is disingenous.
It seems that Germany's descisions on exiting nuclear power plants are always unhappily timed. First, Fukushima happens, making the extension a few months earlier look really weird. Then, the Ukraine war happens, rendering Germany's original plan moot to replace coal with natural gas from russia, and everyone is shaking their head again as Germany is keeping to the original plan.
It was the Greens who campaigned throughout the 80s and beyond to instill irrational fear in German kids in the 80s, so they would opt for an impulsive solution, instead of a rational one in subsequent decades. It was always the Greens whose very platform stood for ending nuclear power, by any means necessary. The reason why Germany today is so staunchly anti-nuclear is because that's how the Greens ("Die Gruenen") defined itself as a political party in the 80s. In fact, that was a (if not the) principal motivation for its inception. The party may seem more mainstream 30 years later, but around the 80s when they laid all the groundwork for the anti-nuclear stance of present day Germany, they were definitely a party still better known for, and even defined by their more radical members.
That the current generation of voters who supported the shutdown of nuclear power production were substantially "encouraged" to adopt such views by said Greens' actions and politics when they were children and teenagers living in the 80s is incontrovertible fact. So, even if Merkel ended up as the one who executed the will of the people as head of the CDU, that will had nothing to do with CDU policy, and certainly not in the 80s and 90s. That was by definition the policy of the Greens, who also laid the groundwork for the irrational fear that Germans in their 40s and 50s have been cultivating for decades.
Why can i say this with complete certainty? Because I was one of those kids.