I agree, its pretty close to slavery. Theoretically, they could sue you if you don't work, although what happens in practice is that if the freelance is really fed up and talks to the end customer saying they want out (which the hiring company does not want you to do), they want to avoid problems with the customer and they will replace you with someone else after a few months.
What they really don't want to do is to lose the billable position. In practice, a lot of people will just suck it up to the end of the contract and then leave, especially if the contract is less than a year.
What if you just don't show up for work? They fire you, right? Do you have to pay some big cash penalty? Or is the hesitance just that you can't get a reference for your next gig?
Legally, they could sue you for the same value that they were charging the customer for your work until the end of the contract, which is the money that they lost by the contractor not working.
In practice, they will probably not do that as the HR team is busy with other things and the lawsuit might be bad PR, although a hiring manager that wants to get back to you for doing that might have the HR department sue you, legally they could do that.
This seems like it's begging for a test case to strike this down on humanitarian grounds. I can't imagine any western judge of any serious level (possibly some county judge in West Texas or something) would take seriously the claim that this wasn't a violation of basic human rights (in US terms, the 14th amendment, though I assume similar principles apply elsewhere), and that such contracts were unenforceable. IANAL and I'm certainly not a limey lawyer, but our notions of justice on both sides of the pond share a lot of DNA.
What they really don't want to do is to lose the billable position. In practice, a lot of people will just suck it up to the end of the contract and then leave, especially if the contract is less than a year.