The story is here.
I outline this area of law here.
I’ve seen citizens be detained unlawfully. I’ve seen permanent residents be detained unlawfully. I’ve seen persons in the United States on visas be detained unlawfully. I’ve even seen unlawfully present foreign nationals be detained unlawfully. The law in this area is fairly well spelled out. No excuses exist for jailers and state and local law enforcement officers to act “outside the law.”