/etc/group file only exists to let the system function in single user boot mode. I wouldn't rely on it for anything other than a possible sanity check for known system groups.
You'll want to use
dscl the directory service command line (and associated dsXXX commands to interact with whatever directory services external to the local store) to retrieve group and user information from the database that normal run time changes and lookups happen.
The manual page can get you started and then Apple developer documentation and specific sites (like this one and code posted at GitHub ) might be good places for follow on research and questions on syntax / scripting / usage.
Also - I would install homebrew and see the output from
brew info wireshark which details the tool to script setting up a security group and change permissions on the device(s) Wireshark needs to own for capture.
If you're not into that package manager - here's a script that might do the trick.