SELECT DeveloperName, Id, Name, ParentRoleId, PortalAccountId, PortalAccountOwnerId, PortalRole, PortalType
FROM UserRole
WHERE PortalRole = 'PersonAccount'
AND PortalAccountOwnerId = '<PortalAccountOwnerId>'
If this returns 2+ records (vs. 1 expected), duplicate portal roles are the cause.
2. Confirm which users are assigned to each role:
SELECT Id, Name, UserRoleId FROM User WHERE UserRoleId IN ('<roleId1>','<roleId2>')
3. The role without a numeric suffix in DeveloperName is the original/canonical role; the suffixed one (...1, ...2, etc.) is the auto-generated duplicate.
Pre-Deletion Safety Checks (run against the duplicate role's Id):
Resolution / Workaround:
If the customer cannot delete the role even after removing users (DELETE_FAILED), check for child roles or sharing dependencies per step above before retrying.
005390305

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.