The mentally unstable are such a tiny portion of society that it is wrong to write legislation for everyone, due to them.
The solution instead is just provide free public mental health treatment so that not one gets that dangerous.
And you still miss the basic premise of the 2nd amendment, which is that all government is always corrupt, and gets more corrupt over time. There has never been a government that is not already corrupt, and will not get worse.
So giving up the ability for rebellion is treason essentially ensuring enslavement of our descendants at some time in the future.
If you do not believe me, then go back and reconsider the government lies we were told in order to get us to support illegal things like the War in Vietnam, the Invasion of Iraq, the Invasion of Afghanistan, etc.