Based on my researching, this command requires a supervised device and the Device Lock access right..
To confirm if a device is supervised, we can check the lock screen or About page:
- On the device's lock screen, it will say This iPhone is managed by "Company Name".
- On the device's About page, it will say This iPhone is supervised. Company name can monitor your Internet traffic and locate this device.
https://learn.microsoft.com/en-us/mem/intune/remote-actions/device-supervised-mode
Hope it can help.