Hello @Pavel yannara Mirochnitchenko
Thank you for being patient while I was trying to reproduce this issue. I found that device.memberof or user.memberof is specifically designed to create dynamic groups that populate by adding members of other groups. As of today, rule editor does not support -notIn or -not for memberOf attribute. We validate this from AAD response when creating a rule with -notIn operator for memberOf attribute.
You can refer following screenshot which shows the error message when you try to validate or save the rule device.memberof -any (group.objectId -notIn ['2272dd76-71ee-465f-902f-cefa8f30c4a0'])
For more information you can refer following documentation links:
Group membership in a dynamic group (preview) in Azure Active Directory: https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-dynamic-rule-member-of
Dynamic membership rules for groups in Azure Active Directory: https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-dynamic-membership
I hope this helps and resolves your query.
----------
Please "Accept the answer" if it helped you. This will help us and others in the community as well.