The price of electricity in Germany isn't the cost of production at face value, it's a complex political beast that's orienting itself by the price of the most expensive form of energy production: coal and nuclear.
It's literally illegal in Germany to sell renewable energy at its own cost (plus adequate profit).
This is a well-meant regulation from a while ago, initially intended to protect the then-fragile emerging renewable market. Now it has the opposite effect.
And Germany and coal - it's... complicated. The CDU/CSU government killed 120k jobs in the emerging renewable energy industry back in 2010, when Germany still was one of the world leaders in photovoltaics, in order to protect... wait for it... 40k jobs in the coal industry. Of course German electricity is as dirty as it gets, and of course it's expensive. It's by design.