Care workers who had to stay overnight as part of their job will not be entitled to back pay at the minimum wage after a Court of Appeal ruling.
The charity Mencap, who won the appeal, argued that a previous tribunal decision which compelled care providers to fund six years' back pay for overnight carers was unaffordable.
And it said smaller employers could be forced out of business by the decision.
But a union said workers should be paid what they were legally entitled to.
Care workers who provide care for people with serious learning disabilities overnight used to be paid a flat fee of around £30, reflecting the fact that they might be sleeping during some of their shifts.
But after employment tribunal rulings involving a Mencap support worker in the East Riding of Yorkshire, HM Revenue and Customs said they should be paid at least the minimum wage for every hour overnight, amounting to about £60.
Employers were told to fund £400 million of back pay but care providers, including Mencap, argued that this was unaffordable.
The Court of Appeal ruled today that care providers had no liability for back pay.
But the union Unison is considering an appeal to the Supreme Court.
Dave Prentis, Unison general secretary, said the ruling was a "mistake" and that the blame should be "laid at the government's door".
"Ministers are so consumed by Brexit that they're ignoring huge problems around them.
"Sleep-in shifts involve significant caring responsibilities, often for very vulnerable people."
But Lord Justice Underhill, sitting with two other senior judges in the Court of Appeal, said: "For the reasons which I have given I believe that sleepers-in… are to be characterised for the purpose of the regulations as available for work… rather than actually working… and so fall within the terms of the sleep-in exception.
"The result is that the only time that counts for national minimum wage purposes is time when the worker is required to be awake for the purposes of working."
However, most employers have now started paying the minimum wage to care workers who sleep overnight while working.
Mencap said it intended to continue to do so despite the court's decision.
Derek Lewis, chair of the Royal Mencap Society, said: "The prospect of having to make large unfunded back payments had threatened to bankrupt many providers, jeopardising the care of vulnerable people and the employment of their carers.
"Many hardworking care workers were given false expectations of an entitlement to back pay and they must be feeling very disappointed.
"We did not want to bring this case."