I was getting the same error as you. I have an environment that has both cloud and on-prem using the same groups. On-Prem is using the User Sync in the Admin tool and it works without error. Cloud is using the Desktop App User Sync Tool and only for certain users returns the " Object Reference not set to an instance of an object " error. For the Groups that have a user that throws this error, no user is added to the group. Also, the user is not added to the Users.
After testing a bit in a small number of users with membership to a particualr group that was failing, I had the customer remove a user at a time to see what would happen. Once a specific user was removed from the group, the rest of the group started acting properly. I then had the customer add back all of the other users and it still worked properly.
Finally, I had then add back the "Bad User Account" and it stopped working again.
So there is some sort of bug going on. Since the On prem works flawlessly and the User Sync tool does not, something is wrong.