The Supreme Court has ruled a lot of things that we would not allow to stand today. For instance, the Dred Scott Case [1] "In a landmark case, the United States Supreme Court decided 7–2 against Scott, finding that neither he nor any other person of African ancestry could claim citizenship in the United States, and therefore Scott could not bring suit in federal court under diversity of citizenship rules. Moreover, Scott's temporary residence outside Missouri did not bring about his emancipation under the Missouri Compromise, as the court ruled this to have been unconstitutional, as it would "improperly deprive Scott's owner of his legal property".
Legislation = Legislation (or statutory law) is law which has been promulgated (or "enacted") by a legislature or other governing body or the process of making it
Qualified Immunity = Qualified immunity is a legal doctrine in United States federal law
Legal doctrine = A legal doctrine is a framework, set of rules, procedural steps, or test, often established through precedent in the common law, through which judgments can be determined in a given legal case
So it's a bit of a grey area, but I think the greater point stands that this is how court cases are decided vs. a law in the traditional sense that people think about laws.