I would go one step ahead of what (Cite Contribution) mentioned: "The amount sounds exorbitant!"
It's not an amount issue at all. It's that this company just has misplaced notions of what hiring is all about.
Replacement Guarantee Clause
Generally, every company that hires through agencies or consultancies has a standard clause in their agreements called the Replacement Guarantee Clause. If the candidate leaves before a specified period of time—for whatever reason(s)—then the agency has to either refund the fees paid or provide a free replacement. Usually, it's 3 months. In your case, this either doesn't seem to be there or has crossed the 3-month timeline where the agency could be refusing to give a replacement.
Hence, the company wants you to become the scapegoat.
It's between the company and the agency... none of your business to get into what's essentially a relationship issue between them.
Generally, at least in the very few instances that we experienced, the agency gives a replacement for a lower one-time fee rate for cases that are technically and legally beyond the Replacement Clause effective timeline, but ethically not really so [after all, it's not a large time span/gap between 3 months and 4/5/6 months].
What to Do
Since you have the complete situation in writing, I suggest informing them through writing that you are being advised to go legal and put everything that is still only verbal into writing, basically generating a written record of the complete situation. Going by general human psychology, the company would hesitate to move forward unless they have something against you or you have not put all the facts here in this posting.
Another Angle
Don't you think you too are at fault for resigning so soon after joining? Unless there are very strong reasons to do so? Especially at your seniority?
I suggest giving this a thought. While technically none can stop you from joining elsewhere whenever you wish to, in the long run, you would be doing your career more damage than good when you jump without strong reasons or justifications in such a fashion.
Regards,
TS