As you say however, constitutions rarely define crimes, and so making the passing of unconstitutional laws a crime would be an unexpected outlier. This is not however what I am talking about.
In passing a law that knowingly violates the constitution, the politicians are acting to _enable_ crimes, or rather, actions considered crimes under existing legislation. This action takes place before the new (later to be hopefully struck down) law is passed, and should be considered a criminal act.
As far as knowing what they are doing affecting their conviction or punishment, I fully agree that not understanding that their actions will lead to "necessarily criminal" consequences, should be considered a mitigating factor.