Negative amount for social security payment. internship in germany

i am an expat studying in Germany.

I did internship in Germany for 6 months till Jan 2023 in a reputed firm. Today I received a mail from HR stating that there was a overpayment with my social security contribution.

"we talked to our payroll team about the negative amount of 1.846,23 € for social security payment. The reason for this is that you put the checkmark as a voluntary internship in the Bebu sheet instead of a mandatory internship. The only way to correct is a confirmation from the University that the internship was mandatory. If your classification was correct, you will find the official payment reminder and your pay slip from January attached."

But the internship I did was voluntary and I specifically mentioned the same in docs requested while singing the contract. Every month I had deduction from my salary for the same and Dec I received some extra payment(around 1000 eur) for which I thought was tax return/bonus. Has anyone faced similar issues? What should I do in this case? I am receiving this mail after 7 months from end of internship period..