Account definition not removed correctly

Hi, I am currently using version 8.2.

I have created a process that updates a field.
This field excludes the identity from the dynamic rule of the Business Role linked to the LDAP account definition.
The process then changes the uid_person to the LDAP account.

My problem is that the identity loses the BR but the account definition (only dynamically assigned via BR) is not removed from the identity.
If I terminate the process the account definition is removed.

How can I ensure that the account definition is also removed at the same time as the process runs?

Thanks in advance.