You're answering your own question here:
Power is imported when it is cheaper to import it than produce it ourselves
After shutting down the remaining 6, then 3 nuclear power plants it became cheaper to import power from Sweden - which used to be blessed with relatively low electricity prices due to to the large hydro and (diminishing) nuclear generation capacity - than to generate it in Germany. While this might have been positive for Germany and for electricity producers in Sweden it is a definite negative for electricity users in Sweden who have seen their prices skyrocket. As to the direct effects of the nuclear shutdown there's quite a bit written, e.g.
https://www.cleanenergywire.org/factsheets/qa-germanys-nucle...
4) What changed in electricity imports and why?
For the first time in many years, Germany became a net electricity importer in 2023. The trade balance for electricity switched from 21 TWh of exports to 22 TWh of imports in the same period. Imports have risen despite sufficient plant capacity in Germany to cover domestic demand entirely. In March 2024, the country announced the shutdown of seven more coal-fired power plant units after the winter, as they are no longer needed to guarantee supply security.
This leaves aside other costs involved with the nuclear phase-out [1] and the knock-on effects of the increased energy prices as well as lower guaranteed availability which is part of the cause of German deindustrialisation. If you doubt whether this actually happening I invite you to peruse a search engine of your preference on the subject which is more effective than me linking to a number of articles from many different sources.
[1] https://olivierdeschenes.weebly.com/uploads/1/3/5/0/13506865...