NUKI not creating entry codes even on successful response

Hello,
we are using NUKI api in our system. Exactly PUT /smartlock/{id}/auth to create NUKI codes with ability to put them onto smartlock and open the door.

Exactly we are sendin
PUT https://api.nuki.io/smartlock/{$smartlockId}/auth

Example of failed body:
{“accountUserId”:1050067519,“type”:13,“code”:969281,“name”:“2411221730-2363”,“allowedFromDate”:“2024-11-22T16:30:00.000000Z”,“allowedUntilDate”:“2024-11-22T18:00:00.000000Z”,“allowedWeekDays”:127,“allowedFromTime”:0,“allowedUntilTime”:0,“remoteAllowed”:true,“smartActionsEnabled”:true}

We got almost always response with no Error and status code 200/204. But unfortunately we some times experiences weird behavirour on NUKI smartlock that some codes are not present! We not receiving any of the error and if we receive error we have repeating session to try create code as many times as possible. But unfortunately we almost always get good HTTP codes.

Can you please help me, what is going on? What HTTP status code means everything is ok?

Implementation of creation new nuki code is following

private static function generateNewCode()
{
    while (true) {
        $code = fake()->numberBetween(111111, 999999);

        $str = (string)$code;
        if (str_contains($str, '0')) continue;
        if (str_starts_with($str, '12')) continue;
        if (NukiCode::where('code', $code)->exists()) continue;

        return $code;
    }
}

Are there some further limitation of creating nuki codes?

Sometimes we get also 502 error, or Operation timed out after 30001 miliseconds. Is this errors common? We usually repeat after this so we have safe operations. But most of the times we got OK result and no NUKI code in smartlock.

Thank you for all your support