Hi,
From what I know, this is expected behavior rather than a bug.
The UnitTest module runs in system context, and when using ExecuteMicroflowAsUser, the microflow is executed in a separate context/transaction. Because of that:
So, as far as I know, UnitTest is not really designed to validate access rules by switching user context.
As a suggestion, you could:
So this seems more like a limitation of how transactions and contexts work in Mendix rather than an actual issue.
If this resolves your issue, you can mark it as accepted.