In the Trump Hush money case, one aspect of the legal theory was that Trump violated New York state tax laws by not properly classifying the payments to Stormy Daniels when he gave money to Michael Cohen. What stands out about this is that he actually overpaid the taxes, and thus there was no financial injury to the state. But still, prosecution argues that the tax documents were indeed "materially false" that he sent to the state.
For reference, these are the instructions to the jurors (emphasis is mine):
The People’s third theory of “unlawful means” which I will define for you now is a Violation of Tax Laws.
Under New York State and New York City law, it is unlawful to knowingly supply or submit materially false or fraudulent information in connection with any tax return.
Likewise, under federal law, it is unlawful for a person to willfully make any tax return, statement, or other document that is fraudulent or false as to any material matter, or that the person does not believe to be true and correct as to every material matter. Under these federal, state, and local laws, such conduct is unlawful even if it does not result in underpayment of taxes.
Judge Merchan clearly accepted these terms, arguing basically "well, the law is the law". But could a judge throw this aspect of the case out, arguing something like "this is complete nonsense and not in line with the spirit of the law" etc. While still allowing the prosecution to move forward with the other aspects of the case (FECA violations, etc.).
Basically, what discretion does a judge have? Could this be challenged on appeal? If the country / state matters, consider this one - New York courtroom.
EDIT: Many comments are challenging whether Trump actually overpaid taxes. I will provide one more source:
In public statements, Bragg all but ignores the tax fraud theory of the case, which involves a somewhat technical violation of the law: Cohen overpaying his taxes to disguise the reason for his inflated reimbursements. Such a claim may be sustainable in a court of law, but a lack of financial harm may not resonate in the court of public opinion.