libcurl's share feature, which is used for a shared connection cache, is not thread safe. This is typically used to support HTTP keep-alive connections. It needs to be removed to improved the stability of the HTTP client when used by multiple threads. This only affects queryable restore. It needs to be backported to all affected versions.
The libcurl documentation (https://curl.se/libcurl/c/curl_share_setopt.html) states
Note that due to a known bug, it is not safe to share connections this way between multiple concurrent threads.
which was added as part of https://github.com/curl/curl/issues/4915.