Maybe that’s different from state to state. I grew up in Hessen but don’t remember having mandatory swimming lessons. I learned it mostly on my own so I don’t even have a „Seepferdchen“ and know a few people from NRW who don’t either. I remember there was the option to do it in school but not sure why I didn’t take it then.
Either way, not being able to swim at all is pretty rare in Germany because going to the pool is a popular activity for kids here.