Germany actually didn't plan to replace nuclear with gas, it wanted to replace nuclear with renewables+gas (later to be replaced by electrolysis). It was of course unfortunate for the climate to shut down the nuclear plants before shutting down the lignite plants.