A cloud-based identity and access management service for securing user authentication and resource access
Can you try performing the operation via the Graph SDK for PowerShell? Here's an example:
Connect-MgGraph -Scopes Directory.AccessAsUser.All
Update-MgDevice -DeviceId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -AccountEnabled:$true
Unfortunately, the permissions required for this operation are a bit excessive, you not only need a valid directory role, but also the blanket/impersonation Directory.AccessAsUser.All. Speaking of roles, as mentioned in the documentation:
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Intune Administrator is the least privileged role supported for this operation. A calling user in the Cloud Device Administrator role can only enable or disable devices and a user with the Windows 365 Administrator role can only update basic device properties.