A judge has admonished the Trump administration, citing "extreme circumstances" in ordering the return of Esteban Rios Sosa.