Try calling the following API to get the local user:
https://graph.microsoft.com/v1.0/users?$filter=identities/any(a:c/issuerAssignedId eq '{user name}' and a/issuer eq '{tenant name}.onmicrosoft.com')
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.