Is that what happened? I am only aware of an injunction against additional deportation flights. There is some uncertainty about the administration's justifications for not complying - they may be entirely correct that the terrorist designation changes the calculus.
And injunctions are far, far from the point at which things are "declared unlawful".