Yes. Exactly. Here is the famous Sen. Stephens case where the same judge through out the charges after the conviction when he learned the extent of the prosecutorial misconduct by the government.
Here is an article from the LA Times about the events in the Stephens case: Ted Stevens charges dismissed as judge excoriates prosecutors
And I just read that nothing happened to the prosecutors in the case. They were given some light suspensions, but challenged them and some administrative judge ruled in their favor. Effin’ amazing, what these people do and get away with.