You seem to be right on this – you cannot access group resources with the ID number, only the name.
The ID referenced here is not an ID, but the name, per
It probably makes sense to refactor the /g/<group-name> route to match how we now handle topics and categories. Something like /g/<group-name>/<id> or /g/patrons/41 and allow /g/41 to function the same way.
Until we fix that up, though, it seems the only way to accomplish what you’re looking for is:
Storing the group name alongside the id
Hitting g/<group-name>/members.json with a GET request to get the members
Loop through those to delete each so you can re-sync.