Need advice on having been overpaid by previous employer

Dear Sir/Madam, I hope this message finds you well. I am Shubham, and I worked as an Assistant Manager at a company shortly after completing my MBA. I am writing to seek your guidance regarding a matter with my former employer. I was employed at the company for two months, but on April 30 (my last working day), I was abruptly removed from the system without prior notice due to alleged low performance during probation. I was asked to leave immediately, with an assurance that my salary would be credited after 45 days. Within 10 days, my salary for the last month was credited, and after 45 days, I received the FNF (Full and Final Settlement) amount. HR contacted me, requested my account details, and confirmed the transfer. Two months later, HR reached out again, stating that the FNF amount was overpaid due to an error, as I was not eligible for it, and they are now requesting a refund. Since the funds were confirmed by HR and credited to my account, I utilized them for repaying my education loan and upskilling myself. Currently, I do not have the extra funds to return the FNF amount. Could you please provide your invaluable insight into the following: Can the company take legal action if I commit to refunding the amount over a few months? What happens if I am unable to refund the amount altogether? Your guidance on the legal implications of this matter would be greatly appreciated. Thank you in advance for your time and support. Best regards, Shubham