Missing access/refresh tokens

We have an working API but we are experiencing some problems regarding oauth. Sometimes the generation of new access/refresh tokens does not work and e receive an error, we lose the tokens and the API stops working. Our development-team cannot reproduce the error because it only happens once in a few hundred calls.

Did some of you have any experience with this problem?

Thanking you in advance.