We add external users with O365 IDs to an Azure group, then grant read permission to them through SharePoint group.
External users need to complete MFA setup before they can access the application so they logon the site at least once.
Occasionally some users can't be found by this api call: _api/web/SiteUsers?&$filter=UserPrincipalName eq toLower(items('O365ID'))
Those users can be found when run check permission on the site, their permission is granted through the SharePoint group.
The purpose of this api call is to find user's ID on the site then grant permission to it.
Pls advise how to resolve the issue or a better more reliable way to get id of the user that has permission on the site, thanks in advance.