429 errors on PUT /api/v2/users — where does the retry logic go wrong?

Trying to bulk update user skills for 500 agents using the Python SDK. Docs state: “Rate limits are enforced per tenant and per API key. Use exponential backoff on 429 responses.” I’ve wrapped the users_api.update_user call in a loop with a time.sleep that doubles each time, starting at 1 second. The code looks like this:

for i in range(500):
 try:
 users_api.update_user(user_id, update_user)
 except ApiException as e:
 if e.status == 429:
 wait = min(1 * (2 ** retry_count), 30)
 time.sleep(wait)
 retry_count += 1

It still fails after about 20 requests. The 429 header includes Retry-After: 5, but my logic ignores that and just uses the calculated backoff. Am I supposed to parse the header manually instead of relying on the exponential formula? The docs don’t explicitly say to override the backoff with the header value.