Hello,
The error is about the permissions granted to the application in Microsoft Entra. Make sure grant all the permissions mentioned in the article and add admin consent. Pay attention that the permissions must be of application type, not delegated.
As an easy option, you can use the script from section Quick app registration with a script.