Platform
Role Hierarchy
The vertical order of roles in server settings. No member — bot or human — can assign, remove or moderate a role positioned at or above their own highest role.
Hierarchy is checked independently of permissions. A bot with Manage Roles will still fail to assign a role sitting above its own, and the API returns a Missing Permissions error that says nothing about position — which is why this is the most misdiagnosed failure on the platform.
The fix is always the same: move the bot’s integration role above every role it manages.