Your question doesn't make sense as stated, as you're conflating two different concepts (a statute vs. the law) and being overly broad in your reference to precedent.
Congress can't pass a statute, for example, that criminalizes oral and anal sex, and expect it to somehow overrule Lawrence v. Texas.
However, if the courts interpret a statute that Congress has passed in a way that Congress does not care for, Congress is free to alter the statute to be more clear.