I've experienced this several times now, and I think I've narrowed it down.
When the script imports groups, it sometimes fails on a group that already exists, but the contents of the group is missing at least one object. (I don't know why that object wasn't exported like all the others). That's not what this issue is about though. What happens next is it seems the script doesn't publish all the other successfully created groups. So instead of having one group incorrectly created, many dozens of groups (or the batch size) aren't published. Fixing up a group manually is OK when it's a once off, but not OK when it's dozens of groups.
I can try to provide more sanitised logs if you can't reproduce this, but it will likely take me several days.
I can work around this by manually creating the missing object, so that erroring group stops erroring.