This is what happens when you do not give the full details.
You should first ask your HR to explain why they claim that January 2022 salary was paid by mistake. Did you work for the month or did you not finish the notice period?
But in either case, no amount can be deducted from Gratuity. You can tell them to pay it to you (irrespective of their other claims against you, which they will have to find alternate ways to recover from you). If they do not do so, you can file a complain with the relevant authority under Gratuity Act, which is mostly the Labour Commissioner of your district.