Jira fails to get refresh_tokens

Hello everyone,
we are trying to integrate our Jira with Gitlab, so that whenever a Jira Issue is mentioned in a Gitlab commit, this commit is shown in the DevelopmentPanel on the Jira Issue. This feature works, but only for two hours, which is when the oauth access token expires. According to our logs, Jira then tries to get a new access token by using the refresh token. This succeeds, but then Jira seems to try again which fails (probably because it is using the same refresh_token, which is now invalid, since it was already used). All subsequent tries then fail aswell.
We suspect, that Jira somehow doesn’t get the new access and refresh token. Does anyone have an idea why this happens? Or is there some special setting we need to use?
For now we are going to try this again but unchecking the “Token Expires” checkbox. But for security reasons we see this only as a temporary solution.

I am looking forward to any answers,
Kind Regards
Caspar Wiswesser