One of the most important tools we have for holding police and other public officials accountable is the ability to sue them when they violate our rights. But the Supreme Court has undermined this vital accountability mechanism with a legal fiction called “qualified immunity.” On Friday, the court will have an opportunity to change course by agreeing to hear a case involving a tragic miscarriage of justice.

Andrew Scott was home playing video games with his girlfriend after midnight on June 15, 2015, when someone began pounding on the door to his apartment. The frightened couple retreated to Scott’s bedroom, where he retrieved his pistol and then made his way back to the living room. Carefully opening his front door, Scott saw an armed man and started to back up. The man immediately fired six shots, striking Scott three times and killing him.

The shooter was Lake County, Florida, Sheriff’s Deputy Richard Sylvester, who was investigating an assault and battery involving a dark‐​colored motorcycle several miles away. Seeing a dark‐​colored motorcycle in the parking lot outside Scott’s apartment — but making no effort to connect the motorcycle to the assault or to Mr. Scott — deputies surrounded the unit, drew their weapons, and banged on the door without identifying themselves. When Mr. Scott answered the door with a gun in his hand, as he had a constitutional right to do, Mr. Sylvester shot him dead.

Mr. Scott’s parents filed a lawsuit, and the deputies moved to dismiss on the grounds that they had not violated any “clearly established” right and were therefore entitled to qualified immunity. The trial judge and the court of appeals agreed. The Supreme Court should take the case and dial back qualified immunity for three reasons.

First, qualified immunity was invented by the Supreme Court out of whole cloth and has no basis statutory text, legislative intent, or sound public policy. Federal law provides that police and other state actors are liable for the deprivation of “any rights.”

But the Supreme Court has qualified that standard (hence the term qualified immunity) by substituting the phrase “clearly established” for “any.” That was a blatant act of judicial policymaking, as University of Chicago law professor Will Baude demonstrates in a recent law review article that utterly destroys the originalist pretensions of qualified immunity.

Second, the clearly established standard is both malleable and perverse. It is malleable because it asks whether existing case law was sufficiently analogous to put officers on notice that their conduct was illegal. But the answer to that question nearly always be gamed simply by dialing the level of generality up or down.

For example, the Sixth U.S. Circuit Court of Appeals issued a decision last week, Latits v. Phillips, in which the judges unanimously agreed that a police officer violated the Constitution by shooting a fleeing suspect, but disagreed as to whether the violation was sufficiently clear to overcome qualified immunity. It all came down to their perception of whether existing case law placed the fact of the violation “beyond debate.” One judge said yes, two said no: case dismissed.

The clearly established standard is not just malleable but also perverse because it provides the greatest protection for the worst conduct. Thus, the more outrageous an officer’s actions, the less likely it will be that anyone else has behaved similarly and the harder it will be to find a case on point. Pity the Georgia man who was recently ordered to cut the head off of his own dog by deputies who shot it for being aggressive. If he sues, the deputies might well win precisely because their conduct was so far beyond the pale.

Finally and most importantly, qualified immunity sends police officers false signals about the constitutionality of their actions. Think about it from a cop’s perspective: The law says I’m liable for the deprivation of any right; this guy sued me for violating his rights, but the judge tossed the case; ergo, I must not have violated any of his rights. That is a grave mistake for one officer to make in a single case; the consequences when countless officers commit the same fallacy in hundreds of qualified immunity cases across the nation are horrendous. Just ask the parents of Andrew Scott.