The issue is not that elections give people a status that puts them beyond the constitution, but that the constitutions rarely make it a crime to pass unconstitutional laws at all:
In most cases of unconstitutional laws, the laws tend to be unconstitutional not because it is against the law to pass them, but because the rules they add can't be reconciled with portions of the constitution in question, and so are found to be invalid or similar.
Even in the case of the US - or any other countries with similar language - note that even in those cases constitutions specifically does not (at least not in any case I know about) follow the pattern of a criminal code: It does not set criteria for punishment. So even if you were to get a court to assign blame and e.g. "convict" Congress, there would be no consequence.
If you want politicians to be punished for passing such laws, then that in itself would require a massive constitutional change.
Generally you should assume that this is intentional, given that the judiciary is explicitly separate and independent, and so one can rarely assume that individual politicians can know whether or not any given law will at some future date be found to conflict with the constitution. Especially given that interpretations of constitutional law, as any other, tends to evolve over time. Sure - there might be the odd really blatant attempt at passing something silly - but those really blatant attempts are also the least dangerous and least important, as they will be struck down quickly.
The dangerous ones are exactly the ones that are sneakily enough formulated that they stand a chance to escape unscathed. But then, those are also the ones where it is unreasonable to assume that the people voting for it had reason to believe it would be unconstitutional.