Scheduling glitches led an immigration judge to deny the Trump administration's request to order four Central American migrants deported because they failed to show for initial hearings in the U.S. while being forced to wait in Mexico.

The judge's refusal was a setback for the administration's highly touted initiative to make asylum seekers wait in Mexico while their cases wind through U.S. immigration courts.

One migrant came to court with a notice to appear on Saturday, March 30, and said he later learned that he was supposed to show up Wednesday. He reported in the morning to U.S. authorities at the main crossing between San Diego and Tijuana.

“I almost didn't make it because I had two dates,” he said.

Similar snafus marred the first hearings last week when migrants who were initially told to show up Tuesday had their dates bumped up several days.

Judge Scott Simpson told administration lawyers to file a brief by April 10 that explains how it can assure migrants are properly notified of appointments. The judge postponed initial appearances for the four no-shows to April 22, which raised more questions about how they would learn about the new date.

Government documents had no street address for the four men in Tijuana and indicated that correspondence was to be sent to U.S. Customs and Border Protection. Simpson asked how the administration would alert them.

“I don't have a response to that,” said Robert Wities, an attorney for U.S. Immigration and Customs Enforcement.

At least two others were given notices to appear Tuesday but, when they showed up at the border, were told by U.S. authorities that they were not on the schedule that day. Their attorneys quickly got new dates for Wednesday but Mexico refused to take them back, forcing them to stay overnight in U.S. custody.

Laura Sanchez, an attorney for one of the men, said she called a court toll-free number to confirm her client's initial hearing Tuesday but his name didn't appear anywhere in the system. Later, she learned that it was Wednesday.

Sanchez said after Wednesday's hearing that she didn't know if Mexico would take her client back. Mexican officials didn't immediately respond to a request for comment.

Homeland Security Department representatives did not immediately respond to a request for comment late Wednesday.

The snafus came two days before a federal judge in San Francisco hears oral arguments to halt enforcement of the “Migration Protection Protocols” policy in a lawsuit filed by the American Civil Liberties Union, Southern Poverty Law Center and Center for Gender & Refugee Studies.

The policy shift, which followed months of high-level talks between the U.S. and Mexico, was launched in San Diego on Jan. 29 amid growing numbers of asylum-seeking families from Guatemala, Honduras and El Salvador. Mexicans and children traveling alone are exempt.

Families are typically released in the U.S. with notices to appear in court and stay until their cases are resolved, which can take years. The new policy aims to change that by making people wait in Mexico, though it is off to a modest start with 240 migrants being sent back to Tijuana from San Diego in the first six weeks. U.S. officials say they plan to sharply expand the policy across the entire border.

Mexican officials have expressed concern about what both governments say is a unilateral move by the Trump administration but has allowed asylum seekers to wait in Mexico with humanitarian visas.

U.S. officials call the new policy an unprecedented effort that aims to discourage weak asylum claims and reduce a court backlog of more than 800,000 cases.

Several migrants who appeared Wednesday said they fear that waiting in Mexico for their next hearings would jeopardize their personal safety. The government attorney said they would be interviewed by an asylum officer to determine if their concerns justified staying in the U.S.

Some told the judge they struggled to find attorneys and were granted more time to find one. Asylum seekers are entitled to legal representation but not at government expense.

U.S. authorities give migrants who are returned to Mexico a list of no-cost legal providers in the U.S. but some migrants told the judge that calls went unanswered or they were told that services were unavailable from Mexico.

A 48-year-old man said under the judge's questioning that he had headaches and throat ailments. The judge noted that migrants with medical issues are exempt from waiting in Mexico and ordered a medical exam.

Elliot Spagat reports for the Associated Press. Associated Press writer Maria Verza in Mexico City contributed to this report.