I have following two queries
SELECT COUNT(Id), PermissionSetId FROM PermissionSetAssignment GROUP BY ROLLUP(PermissionSetId) ORDER BY PermissionSetId LIMIT 1
SELECT COUNT(Id), PermissionSet.Name FROM PermissionSetAssignment GROUP BY ROLLUP(PermissionSet.Name) ORDER BY PermissionSet.Name LIMIT 1
And these are the results in my dev org -
The only difference in these queries is that 1st is grouped by PermissionSetId and 2nd is by PermissionSet.Name
The issue is self explanatory - Difference in count.
Confirming that all permissionset names are unique. I have spotted the permission set that is causing this, is there something fishy going on that permission?
Also confirming that i don't see this anomaly on all the orgs that i have tested. All the permission set names are also unique