Here in the Philippines we have “Ignorance of the law is not an excuse”. I think I also heard something like “Ignorance is not a ‘Get Out of Jail Free’ card”.
I'm not sure if we have something related in Filipino.
But, yeah, it's true. Sometimes it is unfair, but it is up to the judge to decide.