The problem was resolved by enabling the WINHTTP_OPTION_IPV6_FAST_FALLBACK option in WinHTTP, which allowed the client to quickly fall back to IPv4 when IPv6 was slow or unresponsive.
WINHTTP_OPTION_IPV6_FAST_FALLBACK