Hi @Gareth Doherty ,
This is a known limitation of $expand:Returns a maximum of 20 objects., you have to look at alternatives and work with direct /users/{id}/memberOf API.
GET /users/{id | userPrincipalName}/memberOf
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".