The error message "The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid." suggests that the consent is being requested for a scope that is not defined or recognized. The "N/A" value for the permission could be the reason for this error.
To resolve this issue, you need to provide a valid scope in the request for consent. The scope defines the permissions that your application needs to access the user's data. The scope must be a valid URI format, such as "https://graph.microsoft.com/User.Read".
Regarding the error "The method or operation is not allowed" while trying to PATCH the user, this could be because the user does not have sufficient permissions to perform the PATCH operation. The roles you mentioned (Global Administrator, Security Administrator, and Security Reader) should provide the necessary permissions, but it is also possible that there may be other factors affecting the ability to perform the operation, such as policy restrictions.
To create extension attributes, you will need to use the Microsoft Graph API to programmatically create and manage the attributes. You can refer to the Microsoft Graph API documentation for more information on how to create and manage extension attributes: https://docs.microsoft.com/en-us/graph/api/resources/extension-properties?view=graph-rest-1.0