I tried to reproduce the same in my environment and got the results successfully like below:
To authenticate Azure DevOps with the help of the service principle, I created an Azure AD Application and granted the Azure DevOps API permission:

I used the below parameters and generated the code value:
GET
https://login.microsoftonline.com/TenantId/oauth2/v2.0/authorize?
&client_id=ClientID
&scope=499b84ac-1321-427f-aa17-267ca6975798/user_impersonation
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&state=12345

I generated the access token successfully like below:
GET
https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
client_id:client_id
grant_type:authorization_code
code:code
redirect_uri:redirect_uri
scope:499b84ac-1321-427f-aa17-267ca6975798/user_impersonation
client_secret:client_secret

I am able to successfully authenticate Azure DevOps by using access token like below:
