Counts in protected branch / tag access dropdowns are wrong

The dropdowns in project repository settings for selecting roles/users/groups that can modify protected branches / tags display wrong counts when selection changes:

broken-role-counts

Assignee Loading
Time tracking Loading