Ex-Employer Paid an extra Netto salary by mistake, they want it back as Brutto

I left my job due to health conditions around early August in 2024, during the last 8 weeks of which I was on a medical leave. So TK had to pay some portions of my salary for a few weeks. However the company also accidentally paid a pro-rated salary during these weeks so I got double paid.

I realized that and asked what that was about, they accepted the mistake but they are now asking the BRUTTO amount even though I got the NETTO one. They told I'd paid brutto then get the amount back in tax declaration (Steuererklärung). But it's not a small amount and doesn't feel fair to deal with a mistake on their end myself.

So I have a few questions:

  1. Has this happened to anyone before? If so, how did you handle it?
  2. Is it really possible to get the full difference back via tax declaration? Any additional notes etc to be added while filing taxes (I haven't done my taxes in Germany yet)?
  3. Any general recommendations on how I can navigate in this situation?

Thanks a lot in advance