Genesys Cloud .NET SDK token refresh fails mid-batch job

Running a nightly batch job in C# to sync CRM contacts with Genesys Cloud users. The job processes about 5k records, but it crashes after processing around 4.2k. The error is a 401 Unauthorized on a simple GET request to /api/v2/users/me. I’m using the standard PlatformClient with OAuthApplicationClientCredentialsGrant, expecting the SDK to handle the refresh token logic automatically as per the docs. The code looks like this:

cvar client = PlatformClientFactory.CreateClient();
client.AuthorizeWithApplicationCredentials("clientId", "clientSecret", "https://api.mypurecloud.com");
// loop through records
var user = await client.Users.GetUserAsync(userId);

The docs state that the SDK “automatically manages token lifecycles”. Yet, the HttpClient underlying the request seems to be using a stale token. I’ve checked the logs and the Authorization header is definitely present, just expired. Is there a specific setting I need to enable for automatic refresh in the .NET SDK, or do I need to implement a custom DelegatingHandler to catch the 401 and re-authenticate? The job runs in an Azure Function, so I can’t just keep a long-lived interactive session.