The mechanism is that a court first issues a nonsense opinion upholding the unconstitutional law. Then, with the passage of time, the law becomes long standing. And all long-standing prohibitions on the RKBA, whether they were constitutional to begin with is irrelevant, become constitutional.
That's SCOTUS-quality reasoning, see Scalia in Heller.
*sigh* — It's all true.
(And why I loathe the USSC.)