I tried to reproduce the same in my environment and got the below results:
When I ran the same query in Graph Explorer, I'm getting CORS error like below:
GET https://graph.microsoft.com/v1.0/reports/getTeamsUserActivityUserDetail(period='D7')
Response:

So, I tried to do the same via Postman by registering one Azure AD application and added Reports.Read.All permission without granting consent like below:

I generated access token via Postman with parameters like below:
POST https://login.microsoftonline.com/<TenantID>/oauth2/v2.0/token
client_id:appID
grant_type:client_credentials
scope:https://graph.microsoft.com/.default
client_secret:client_secret
Response:

When I used this token to call query, I got same error as you like below:
GET https://graph.microsoft.com/v1.0/reports/getTeamsUserActivityUserDetail(period='D7')
Response:

To resolve the error, make sure to grant admin consent to Reports.Read.All Application permission like below:

I generated access token again after granting admin consent.
When I used that token to call the query, I got response successfully like below:
GET https://graph.microsoft.com/v1.0/reports/getTeamsUserActivityUserDetail(period='D7')
Response:

If you granted admin consent to Reports.Read.All of Delegated type, you will still get 403 Forbidden error.
So, make sure to add Reports.Read.All of Application type and grant admin consent while using client credentials flow.