Inspiring, coaching, critiquing, training, promoting, problem-solving. There is no shortage of work to be done by good managers.

A federal judge in San Francisco has ordered food-delivery startup DoorDash to arbitrate more than 5,000 workers’ labor disputes, a ruling that could cost the company millions.

In a decision on Feb. 10, US district judge William Alsup wrote that for decades employers have forced arbitration clauses and class-action waivers, taking away their right to go to court and to sue collectively. “The irony, in this case, is that the workers wish to enforce the very provisions forced on them…,” he noted.

Similar to other gig-economy platforms, DoorDash includes an arbitration agreement in its contracts with couriers, or “Dashers,” who deliver customers’ food orders. But after facing a flood of claims, DoorDash balked at the costs of going into arbitration.

“No doubt, DoorDash never expected that so many would actually seek arbitration,” Alsup concluded. “Instead, in irony upon irony, DoorDash now wishes to resort to a class-wide lawsuit, the very device it denied to the workers, to avoid its duty to arbitrate. This hypocrisy will not be blessed, at least by this order,” he wrote.

The couriers allege they were improperly classified as independent contractors rather than employees. Because they could not bring their cases to court, 6,250 DoorDash couriers brought their claims to an arbitrator, claiming violations of the Fair Labor Standards Act and the California Labor Code.

In October, the American Arbitration Association (AAA) ordered DoorDash to pay $12 million in administrative fees to process the cases; the couriers themselves paid more than $1.2 million in filing fees. DoorDash refused to pay, arguing that many of the workers seeking arbitration did not have valid claims—and prompting the couriers to ask a judge to intervene.

The company successfully argued there was no proof that 869 of the couriers had valid agreements containing the arbitration clause. The judge said DoorDash would not have to arbitrate those claims, but it would still need to arbitrate 5,010 claims from delivery workers with valid agreements. The arbitration association requires that each individual bringing a claim pay a filing fee of $300, while the responding company must pay a filing fee of $1,900. That means DoorDash, which is valued at $12.6 billion, is still on the hook for roughly $9.5 million in fees.

There’s a growing number of companies forcing workers to sign arbitration agreements, and research shows employers often win. Under the agreements, workers typically cannot take employers to court over claims of sexual harassment or employee discrimination, and instead must submit to arbitration procedures.

Workers have increasingly been speaking out on forced arbitration. Last year, a group of Google employees launched a social campaign to pressure their employer and other Silicon Valley companies to drop forced arbitration. The share of workers subjected to mandatory arbitration is now at least 55%, according to the left-leaning Economic Policy Institute.

Rather than paying up, DoorDash asked to suspend the court proceedings until the approval of a settlement could be reached in a separate class-action case, given the potential overlap between couriers seeking arbitration and couriers covered in the class action. (Ironically, DoorDash originally sought to dismiss that case on the grounds that the couriers had a duty to arbitrate.) The judge wasn’t having it.

“You’re going to pay that money,” Alsup said in court, according to a Courthouse News Service report. “You don’t want to pay millions of dollars, but that’s what you bargained to do and you’re going to do it.”