This is not true even in the slightest.
The law is not a deterministic computer program. It’s a complex body of overlapping work and the courts are specifically chartered to use judgement. That’s why briefs from two parties in a dispute will often cite different laws and precedents.
For instance, Winter v. NRDC specifically says that courts must consider whether an injunction is in the public interest.
"public interest" is a much more ambiguous thing than the written law
Yes. And, that's why both sides will make their cases to the court as to whether the public interest is served by an injunction, and then the court will make a decision based on who made the best argument.