Role Removal Issues

@acrumley i don’t see your complete code, may be you can post your complete code then will dig more.

but you see the samples from other user and fix.

Rule that removes negative = true from an identity - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community

you can handle by plan also. no need to api method.
samples here : How to remove (de-assign) a role from identity via the API - Compass