Valid point. However, I don't think the handgun law was ever challenged all the way up to the Supreme Court. I could be mistaken.
Yes, you are correct. The following is from a Feb. 26, 2018 article on the New Republic site
"Americas regulations on gun purchases dont make much sense no matter how you feel about the Second Amendment. By federal law, only people 21 and older can buy a handgun from a licensed dealer, but 18-year-olds can buy shotguns and riflesincluding the infamous AR-15.
In 2012, the National Rifle Association implored the U.S. Supreme Court to fix this inconsistencyby allowing people under 21 to buy handguns. In its petition, the gun-rights group told the justices that young Americans should not be deprived of their constitutional right to buy a specific class of firearms. It is undisputed that 18-to-20-year-olds were not only permitted but required to keep and bear arms when the Second Amendment was ratified, the NRAs lawyers wrote. A group of conservative attorneys general from 22 states filed a brief backing the NRAs petition.
For whatever reason, in what has become a trend on gun cases, the court decided not to accept the challenge."