The entire concept of the "Energiewende" was implemented without putting the right constraints in place. The conservatives later fumbled it instead of adding the right changes.
What happened is that the subsidies for renewable energy in Germany mostly led to a buildup of a huge photovoltaic industry in China after an initial goldrush in Europe. When they changed the incentive scheme, the German photovoltaic industry crumbled and the chinese one was kept afloat with local subsidies.
For a while, the equipment suppliers in Europe still profited from the boom in China, but where eventually replaced by Chinese ones. In effect, now both the photovoltaic industry and the equipment industry in Europe largely disappeared.
And to add insult to injury, China is considering to limit photovoltaic exports (potentially as a means to counter the semiconductor sacntions):
https://www.scmp.com/business/article/3208206/chinas-propose...