The fact that you need a judge to tell you if what you did was wrong is indicative of a flawed system
No it is not a flawed system. That is literally the legal system at work (at least the Westminster / US systems with judge-developed case law). Legislature writes the law, and nobody knows for sure what constitutes "complying with or being in breach of that law" until judiciary rules on it (sometimes decades later!).
If that can’t be determined from the text is that not a problem ?
I’m not saying judges are useless but a system that operates in a less clear way only favors those with money and influence
> Laws aren't computer code. They are vague on purpose.
Yes... but. Tax law is a bit different because it is similar to an equation: you put in your inputs and you get your outputs.
There have been famous cases where the courts have said in essence, "yes you completely and exactly and precisely followed the law, but we're not going to allow you to do that anyway." Those rulings have become less frequent.