Gitlab refresh token flow erroring out with invalid_grant error

Hello everyone, Iam currently using OAuth to obtain the access token of the user and the refresh token as well. The refresh token seems to be working fine for 1-2 days every time to refresh the access token and then obtain the new refresh token. But the latest refresh token doesn’t seem to work when trying to refresh the access token after 4-5 days. The refresh token call fails with an error called invalid_grant with the error message stating

The provided authorisation grant is invalid, expired, revoked, does not match the redirection URI used in the authorisation request, or was issued to another client.

Is there any window or limit for the refresh token to be used to obtain the new access and refresh tokens for Gitlab?
If there is any documentation regarding such validation windows for the access tokens and the refresh tokens can you share it here?