You will find that the California Vehicle Code, throughout its text, repeatedly empowers "peace officers" as defined by section 830.6 of the Penal Code.
The code section you list above empowers large counties to take on a larger role usually reserved for the highway patrol, but it does not restrict enforcement of the law by smaller counties or local police.
If the citation for expired registration was issued by any peace officer as defined in PC 830.6 then it is quite valid. A Fish & Game officer could issue such a citation.
In contrast, a deputy sheriff would not typically stop a commercial vehicle for safety inspection as such stops are generally done by CHP. However in a large county where such authorization has been made by the Board of Supervisors the sheriff's deputies could legitimately take on that role (and others).