Stop me if you’ve heard this one.

St. Peter is greeting new arrivals at the gates of Heaven. In the background, God is raging, barking orders, behaving irrationally. “Don’t pay any attention to Him,” St. Peter says. “He just thinks he’s a federal judge.”

The federal judiciary is one of the glories of our government. The judges, who are appointed by the President and serve for life, enjoy great independence and generally serve with distinction and honor. By the standards of the legal profession, they are paid poorly (less than two hundred thousand dollars a year), but they enjoy considerable prestige. In the light of this, perhaps understandably, there is an institutional weakness for arrogance, pomposity, and petulance in the federal judiciary. Exhibit A is the behavior of the United States Court of Appeals for the Second Circuit in the recent stop-and-frisk case.

On August 12, 2013, the federal judge Shira Scheindlin ruled, following a lengthy trial in Foley Square, that the New York City Police Department had, with its stop-and-frisk policies, engaged in a pattern and practice of racial profiling, and had violated the constitutional rights of New Yorkers. (The Center for Constitutional Rights, a lead counsel in the case, has collected many of the documents related to it.) The decision played a part in the recent mayoral election, which propelled Bill de Blasio, an outspoken opponent of the city’s stop-and-frisk policies, to victory.

After Scheindlin’s ruling, the city, through Michael A. Cardozo, the corporation counsel, began the process of appealing the decision. Then, suddenly, on October 13th—without a specific request from Cardozo or anyone else—a three-judge panel on the Second Circuit removed Scheindlin from the case and issued a stay on the remedies she had ordered, including directing an independent monitor to make sure the N.Y.P.D. followed her rulings. (I criticized the Second Circuit’s removal of Scheindlin that day.)

What happened next was extraordinary. Judges, no less than litigants, generally accept the rulings of the Second Circuit with a kind of grumpy servility. The Supreme Court reviews only a handful of Second Circuit rulings each year, so the appeals-court judges almost always have the last word. The legal culture in New York also reflects a kind of reverence for the Second Circuit, which has included such worthies as Learned Hand and Henry Friendly, whose busts flank the courtroom. District judges in the states covered by the Second Circuit (New York, Connecticut, and Vermont) tend to take their lumps from the appellate court in silence.

Not Scheindlin. As I noted in my piece about the judge, last May, she has never fit in with her colleagues on the Southern District bench. Unlike many of them, she was never an Assistant United States Attorney in Foley Square, and she has a testy relationship with prosecutors there. (They tend to describe Scheindlin as “difficult,” “shrill,” and “demanding,” terms that never seem to be applied to male judges, or to men generally.) So perhaps it was not entirely surprising that Scheindlin, rebuffed by the Second Circuit panel of Judges John M. Walker, Jr., José A. Cabranes, and Barrington D. Parker, Jr., fought back. She enlisted four law professors, Burt Neuborne, Norman Dorsen, Arthur R. Miller, and Judith Resnik, as well as a former corporation counsel, Frederick A. O. Schwarz, Jr., to represent her and challenge her disqualification. Last week, they filed a brief on her behalf before the Second Circuit.

The Second Circuit removed Scheindlin on the ground that she hoarded the stop-and-frisk case in violation of the court rules on related cases, and that she talked too much to the press (including to me, for my Profile). The new brief, largely written by Neuborne, a well-known civil libertarian, argues that the appellate judges garbled what happened in the case—not so hard to do, given that they acted without a hearing or even a word of defense from Scheindlin. Likewise, the Neuborne brief makes a strong case that Scheindlin violated no rules in her statements to the press.

Still, it’s not clear how, or even whether, the Second Circuit will give Scheindlin’s lawyers a day in court. The stop-and-frisk case is now in a procedural tangle, with some matters before the Second Circuit, some before a new district judge, and Scheindlin still clamoring to be allowed back in.

The city, meanwhile, is using the disqualification as a wedge to persuade the Second Circuit to junk Scheindlin’s ruling in its entirety—and to do so before Michael Bloomberg’s term as mayor concludes at the end of the year. In its brief, the city notes that “the effectiveness of a city’s police department depends importantly on the respect and trust of the community and on the perception in the community that it enforces the law fairly, even-handedly, and without bias.” No kidding. Bloomberg should have thought of this principle before he defended stop-and-frisk against quite reasonable criticisms. Bloomberg has much to be proud of in his law-enforcement record over the past twelve years; crime has plummeted. Indeed, the N.Y.P.D. has implicitly recognized its own excesses with stop-and-frisk, and has dramatically cut back the number of confrontations in recent months—with no uptick in the crime rate. But, rhetorically and legally, the city continues to insist that it did nothing wrong, and the old-boy network at the Second Circuit seems poised to agree.

Fortunately, a resolution appears at hand, in the inauguration of de Blasio on January 1, 2014. As the city’s public advocate, de Blasio produced a report that anticipated Scheindlin’s findings. The report concluded, among other things, that while “African-American and Latino New Yorkers comprise only 54% of the general population, they constituted 84% of all stops in 2012, and 88.8% of the people stopped were not charged.” As public advocate, de Blasio filed his own brief in the Second Circuit urging the court to let Scheindlin’s rulings go into effect.

De Blasio did not demand an end to all stop-and-frisks—that would be irresponsible—but, rather, “to change the way the NYPD has been utilizing stop-and-frisk consistent with the NYPD’s ability to continue its magnificent performance over the past 23 years of dramatically reducing crime.” That’s a task for mayors, not peremptory judges. De Blasio will soon have his chance to end this case by getting that job done.

Photograph by Andrew Burton/Getty