It's fine to be unhappy about your own stupidity but to break the law in response to your own stupidity takes stupidity to a new level.
I understand your general point but I would opine that breaking laws is not always immoral and that committing an immoral act is worse than breaking a law. In this case it would be immoral and illegal. One deals with God's law and one with how man interacts with other humans.