The prosecutor seems to have over-charged the case due to frustration over the failure of the search to find anything related to the alleged sex offense. I suspect that the search warrant may therefore prove defective.
According to my wife, who works at the local PD, having a gun when drugs are also present is an automatic felony charge. As for the drugs, my guess is substantial quantities must be involved.