Wikipedia
Mistake of law
Mistake of law is a legal principle referring to one or more errors that were made by a person in understanding how the applicable law applied to their past activity that is under analysis by a court. In jurisdictions that use the term, it is differentiated from mistake of fact.
There is a principle of law that " ignorance of the law is no excuse".