“They took her and we would wait for her to come back every day,” said Marbeli Bustillo, 23, a fellow asylum seeker who met Ms. Hernandez in the “hielera,” or “ice boxes,” where people crossing the border are held before they are processed by ICE, and who was held along with Ms. Hernandez at the Cibola County Correctional Center.

“We wondered every day where they might have put her, why we didn’t see her anymore,” Ms. Bustillo added in a phone interview from Boston, where she moved after gaining asylum. “We never saw her again after the doctor took her.”

In the past, transgender women detained by ICE were held with male detainees. In 2015, the agency established new guidelines for detaining transgender women because of how vulnerable they are in detention centers. There has also been a spike in the number of openly L.G.B.T. people from Central American countries and Mexico seeking asylum in the United States because of the violence they often face in their home countries.

“Her death was entirely preventable,” Lynly Egyes, the Transgender Law Center’s director of litigation, said at a news conference. “In the final days of her life, she was transferred from California to Washington to New Mexico, shackled for days on end. If she was lucky, she was given a bottle of water to drink. Her cause of death was dehydration and complications related to H.I.V.”

The independent autopsy was likely to face scrutiny over Dr. Sperry’s credibility. He was the chief medical examiner for the state of Georgia until 2015, when he stepped down after The Atlanta Journal-Constitution reported that he had taken on hundreds of private cases while working for the state.

“We decided to go with Dr. Sperry because he’s good at his job,” Andrew Free, an immigration and civil rights lawyer who is representing the Hernandez family, said in an interview.

The Cibola County Correctional Center is operated by CoreCivic, one of the largest operators of private prisons in the country with revenue last year of $1.8 billion. Privately operated prisons have been under scrutiny for their handling of immigrant detainees, especially migrant children.