Invoke-RestMethod with -usedefaultcredentials will execute API and ignore Roles security

It is not. Here’s the details that include the affected versions: Security Notice: PowerShell Universal Authorization Bypass