Would it be possible to completely replace the userinfo endpoint with the other REST endpoint you are mentioning? That should work, as you can change the endpoint URL that Moodle uses – unless that REST endpoint is missing some other data...
General developer forum
Custom OAuth2 Service
This discussion has been locked so you can no longer reply to it.