The "rule of precedent" is not described accurately in the question. A definition can be found in Kempin, Precedent and Stare Decisis: The Critical Years, 1800 to 1850 (1959) 3(1) American Journal of Legal History 28:
The modern doctrine of stare decisis as applied in the United States is a general policy of all courts to adhere to the ratio ...
The concern raised is a real one, but it is much less serious than one might naively expect.
Precedents Apply Only To Resolve The Legal Arguments Presented On The Facts Found To Exist At Trial
A Bad Lawyer's Failure To Develop Facts At Trial Isn't A Serious Problem
A precedent determines the law as applied to a particular set of ...
Some jurisdictions codify maxims, many do not, but these maxims still exist.
Nullus commodum capere potest de injuria sua propria (no one can take advantage of his own wrong) is a generally recognized principle of equity, broadly connected to the principle "who comes into equity must come with clean hands" and the covenant of good faith.
Some civil ...
Asset Forfeiture, which removes any property that was gained through illicit means from the person or persons who gained them. This can range from contraband items such as drugs, illegal arms, counterfeit currency or products, or illicit goods under embargo or protective custody as well as ordinary legal items such as moneys or legal goods procured through ...
Because similar situations should have similar consequences
Surely that’s fair?
It would be profoundly unjust that you and I could perform a similar act in similar circumstances and you go to jail for 6 years and I get acquitted.
Unless, of course, my lawyer is clever enough to distinguish may case from yours or convince an appeals court that your case was ...
This answer is under United States law.
Usually, when a court interprets the law in a way that was previously ambiguous, parties are not given any leniency for not knowing in advance how an issue will be resolved.
Sometimes, when a court overrules prior precedent with a new precedent the court will grant some leniency, if there is an easy way to do so.