BigDogatPlay is correct considering this took place at a public shooting range. You are actually lucky that the deputy allowed you to just walk around him and leave like that because it appears the deputy had legal standing. This tells me either the deputy wasn't 100% sure he was within legal bounds or he just didn't think it would be worth the drama.
There is a couple of shooting ranges in my beat, but we generally do not go in the ranges and do weapon checks. The feds show up once in a blue moon and do them. I like to leave folks at the range alone. They are there for recreation, not to rob or murder someone.
"If you expect logic associated with California law, it will only make your head hurt.." - Ron-Solo, 2013