Hi,
This is because the update of a role mapping does not "add" but "overwrites", you use the api to define how it should look, no matter of the current state.
I also responded to your question about removing users; You can use the same approach here by first retrieving the current implementation and then updating it with the desired set.
Another approach you could take is to use Terraform if you are familiar, it can handle the logic for you.