The law is so complex that many attorneys and judges have no idea what the law is.
I remember when I was practicing law decades ago and a woman came to me who was charged with two felony counts of writing a check against insufficient funds. She had never had any problems with the law during her entire life (she was then over 50) and was terrified that a conviction could ruin her reputation and her business.
After thoroughly researching the law, I called the state attorney (SA) and asked if we could negotiate an arrangement whereby she could avoid having a conviction on her record. The SA actually laughed and told me I had no leverage to negotiate because my client had insufficient funds in her account when the checks were written. I told him it was immaterial how much money was in a defendant's account when the checks were written; rather, under state law it was not a crime unless a person wrote a check knowing that there would be insufficient funds in the account when the check was presented for cashing and my client reasonably believed the funds would be available at that time. The SA told me that was not what the law said, and I responded by telling him that was exactly what the law said and furthermore I was reading the law verbatim from a document which bore his signature!
Then things got interesting. I told him that not only did he not have a case but he didn't want this case to go to trial. I informed him that once the public became aware of what the law really said defendants would be coming up with imaginative reasons why they truly expected money to be in their account when the check was presented for cashing even though their accounts were empty at the time the checks were written. The case was settled with a fine and dismissal of the criminal charge.