It was the trial court that was declared to be in error for taking judicial notice. Of course what they took notice of, implicitly that is, was not relevant. The second amemdent, while it protect keeping and bearing "militia" arms, is not limited to protecting just those. Arms is arms. IIRC, the trial court never mentioned militia arms in it's ruling. But you can check the record which can be found here
Miller's case never went to trial. Per the Supreme Court, there was a contested relevant fact, and therefore the case had to go to trial to at minimum resolve that before any final action could be taken.