Right vs Permission
This is another case of the state refusing to recognize the 2nd Amendment as a Fundamental Right. The Constitution does not read: "The right of sighted citizens....", nor "The right of sober citizens.....", nor "The right of the citizens approved by the government......"
It reads simply: "The right of the citizens....." It doesn't limit the right nor establish the right for any specific purpose (although the court certainly has). It specifically denies the state any authority over the right. As a result of McDonald the right is fully enforceable against the states & their subdivisions. So in this case the judge got it exactly right. The guns are not the property of the state nor does the state have any right to confiscate them. The 2nd Amendment protects the right.
The bad news here is that the state will find some other nonesense to charge this guy with. Discharging a weapon within city limits, reckless endangerment, drunk & disorderly, whatever. As you are fully aware gun control isn't about guns, it's about control. Control over the state's slaves.