Inspired by [this question](https://politics.stackexchange.com/questions/45895/could-boris-johnson-face-criminal-charges-for-illegally-proroguing-parliament) and answers to it.

While I'm reasonably sure the answer is "No", I wonder if there is some interesting exception to the general immunity of legislative bodies. While a generic "misconduct in public office" or analogues can be, in some countries, applied to members of the legislative, I want a more specific law.

What I'm looking for is a law with following properties:

1. It specifically concerns legislature's members.
2. It sets specific bounds on what laws can be introduced to the legislature.
3. There is a punishment for whoever introduces an illegal law and/or votes for it.

Bonus if someone was actually prosecuted for this.

Non-democratic examples and historical examples are fine.