The Trump administration on Monday urged a federal court to dismiss the high-profile case of Kilmar Abrego Garcia as moot following his return to the country.
It actually happens a lot, but it's not the judge who dismisses it, but the prosecutor's office.
There are plenty of times where the prosecutor pursues bogus charges to intimidate a citizen into taking a plea deal of a lesser charge. And if the citizen fights to go to a jury trial, the prosecutor will drop the charges so it can't go on record that they are clearly acting corruptly to protect their own.
Like this case where a citizen was arrested for calling a cop a dumbass and afterwards the prosecutor attempted to trump up the charges to aggravated assault and then dismissed charges like a week before his jury trial.
Contempt of Court is a bit different. It's usually applied until the problem action is corrected. For instance, they could (in theory) hold the administration in contempt, meaning fines or even jail, until they comply with the court order to return him.
Now, they can and absolutely should be prosecuted for their actions, but it would likely need to be a separate case.
Looooook he's baaaaack so don't worry bout it!!! - DOJ
Discovery is still needed to uncover exactly why the government took so long to do what they said they totally couldn't do but suddenly became able to, coincidentally after they found other reasons to detain him.
"He is not coming back to our country," [Attorney General Pam] Bondi told Fox News [in April], in response to a question about his legal status during the briefing.
From the link at very end of article. What a bitch.