Jira Cloud REST API gives inconsistent permission errors

Our app runs JQL queries using Jira Cloud REST API on behalf of the end user to do its thing. The endpoint is called via AuthenticatedAsHostActor.

Most of the time there is no problem but from time to time we get a false positive permission error from Jira Cloud. Something like this:

The ‘project’ field with value ‘ABC’ does not exist or you do not have required permissions to access this field.

The customer user definitely has access to that project and in fact if the user repeats the action right away, he/she gets the query results without a problem. Similar things happen for fields or JQL Filters as well.

The error is produced and message is sent clearly from Jira Cloud so somehow Jira Cloud thinks that the user does not have permission. But sending the very same request twice gets the data so I can’t see what is causing this inconsistency.

What am I missing?