I suspect the number of groups itself is not the real problem, but that the token is persisted and the field is not big enough to accomodate the value.
The error you pasted is returned by the provider when asking for the userinfo, so it's failing on Keycloak side, apparently. I don't see what we can do on XWiki side for that.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.