I am trying to execute a graph api request but it returns a bad request. It has all the permissions indicated in the official documentation and I don't see where it could be wrong in its syntax.
Get token:
Your using a service principal to authentication eg the client credentials flow so the /me endpoint isn't valid (which is what that error message is telling you). You need to target a specific user eg
/users/{id | userPrincipalName}/profile