The constitution is not immutable. See the 18th and 21st amendments.You’re correct. Technically, those laws are against the constitution. As a society, we overlook these violations of the constitution because we agree that they’re in the best interests of society as a whole, at the expense of a loss of some rights by some people.
However, it’s a slippery slope. Who determines whom is mentally disabled? Homosexuality was a disorder in the DSM until 1973. You could argue that determining who is a Felon is clear cut, but what if stealing a candy bar becomes a felony?
A lot of anti-gun laws would be deemed unconstitutional if they made it to the Supreme Court, which is why laws are changed or dropped if challenges start making their way through the courts.