Hi,
Prompt to a user will be useful for this case: “You did not select a primary role. All roles will be revoked from selected user(s).
It’s good option
But, I think It will not work in case of user only want to change additional role for multiple user with different primary role.
So as per my opinion, we should not overwrite primary role if primary role is empty. and we can add option in dropdown for revoke all roles.
This way it will be work for all.