Good that you've got it working.
Group ID, like User ID, is a number that is associated at OS level with the group name. When you recreate a group with the same name it may not get the same ID and then the permissions (which resolve to ID) won't work. There should be some consistency for OS level groups but additional groups will be numbered differently.
On the SSH command line run the command id
and you'll see (along with uid info) something like this:
gid=100(users) groups=100(users),101(administrators),1023(http)
For users, when I build a new Mac I always create the admin user first. That ID will be the same on all the Macs then. Now I want to create users fred and bert: on Mac1 I create fred then bert; on Mac2 I create bert then fred.
The user ID for fred on Mac1 will be user ID for bert on Mac2, and vice versa. So I don't do this, I always create fred, bert, tom, dick, and then harry if there's a chance of moving stuff between machines at a Unix level.
I've experienced unpacking archives from one machine to another where this has happened. And where there's no user on the target machine with the user ID then files are owned by the User ID only.