You'd have to ask a lawyer if this would fall under probably cause - i.e. a police officer is allowed to arrest someone if they have a "reasonable" suspicion that a crime was committed, and then the prosecutors decide whether to bring charges. It's not clear to me how a court would view an officer being mistaken about the law in specific ways.