Group membership is not related to UPN - it is determined by the member's (user's) ObjectID value in AAD, which will then be translated to the ID value of that respective object in the connected SCIM directory. The user must be successfully provisioned across and managed by the AAD Provisioning Service in order for AAD Provisioning to have discovered the user's SCIM ID value, which is required for the AAD Provisioning Service to be able to translate from AAD ObjectID -> SCIM ID.
The most likely scenario is that the users being excluded from group memberships were created in the other/SCIM system via some other means besides SCIM, and the AAD Provisioning service has not successfully started managing them, as outlined above. If that doesn't pan out, I'd suggest opening a support case with Microsoft via the Azure/Entra portal(s).