What causes Bearer was challenged error in IdentityServer4?

I have a standard REST API with ASP.NET 5.0. I am using the IdentityServer4 Bearer scheme for Authentication. All of my controllers and actions were working until today one of them gives this bizarre Bearer was challenged error. The same client calls many other endpoints and only this one doesn't work. What could the problem be?

IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler: Information: AuthenticationScheme: Bearer was challenged.
Failed to load resource: the server responded with a status of 401 () [https://localhost:44350/api/File/StarFolder?folderId=310998e6-9da5-43f9-b70f-f0650c54a8cd&star=true]
IdentityServer4.Hosting.IdentityServerMiddleware: Information: Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryEndpoint for /.well-known/openid-configuration
IdentityServer4.Hosting.IdentityServerMiddleware: Information: Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryKeyEndpoint for /.well-known/openid-configuration/jwks
IdentityServer4.Hosting.IdentityServerMiddleware: Information: Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token
IdentityServer4.Validation.TokenRequestValidator: Information: Token request validation success, {
  "ClientId": "quickapp_spa",
  "GrantType": "refresh_token",
  "AuthorizationCode": "********",
  "RefreshToken": "****4135",
  "Raw": {
    "refresh_token": "***REDACTED***",
    "client_id": "quickapp_spa",
    "grant_type": "refresh_token"
  }
}

Controller code:

[Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme)]
[Route("api/[controller]/[action]")]
[ApiController]
public class FileController : ControllerBase
{
    [HttpPost]
    public async Task<IActionResult> StarFolder(string folderId, bool star)
    {
        // Code, which is never reached.
    }
}
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum