Role Identity List UI Bug When Adding Members from API

On the roles page for Identity List, if you are performing a PATCH to the /membership/identities section of a role and are adding members, it doesn’t do any check to see if the identity already exists, so it allows you to add multiple identities thus creating a UI bug:

Notice how it says “3” results when there are only 2 entries:

You can see in the backend that it just lets you assign the same exact identity with the same ID. This should be prevented by the API so it doesn’t cause UI bugs.