Hard to say without knowing what context the deputy had for making contact with people leaving the range in the first place.
If you are transporting firearms in a public place a peace officer may demand to examine them to be sure they are being transported lawfully. It is not a search and you are required under the law to submit or face a criminal penalty. Since you were leaving a place where firearms can be lawfully discharged and perhaps he saw you putting firearms into your Pelican the deputy has the authority of the Penal Code to examine them.
That the deputy let you walk away I find interesting.
-- Rifle, Pistol, Shotgun
Not a lawyer, just a former LEO proud to have served.
Americans have the right and advantage of being armed - unlike the citizens of other countries whose governments are afraid to trust the people with arms. -- James Madison