
There was a bug at one point that caused this error but, as far as I know, it was fixed some time ago. Please see this blog post to see if it helps: SharePoint Online- Bad service principal breaks SharePoint Admin API Access “Global Service Principal ID Error: Error: {}” Resolved