Google.Cloud.Translate.V3, error GRPC Failed to pick subchannel when translating with TranslationServiceClient

we are developing a service that uses translation through Google and currently facing the following issue: translation through Google.Cloud.Translate.V3 returns the following error:

DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1634748240.500000000","description":"Failed to pick subchannel","file":"..\..\..\src\core\ext\filters\client_channel\client_channel.cc","file_line":3009,"referenced_errors":[{"created":"@1634748240.500000000","description":"failed to connect to all addresses","file":"..\..\..\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":398,"grpc_status":14}]}")

Setting up environment variables https_proxy, http_proxy does not help. At the same time, translation through console version gcloud returns correct result. E.g. when we use gcloud through curl to obtain bearer-token and perform translation:

curl -k -X POST -H "Authorization: ... " -H "Content-Type: application/json; charset=utf-8" https://translation.googleapis.com/v3/projects/.../locations/us-central1:translateText -d @request_sq.json
TranslationServiceClient client = TranslationServiceClient.Create();
TranslateTextRequest rq = new TranslateTextRequest()
{
    Contents = { "It is raining" },
    TargetLanguageCode = "fr",
    SourceLanguageCode = "en",
    Parent = new ProjectName(json.project_id).ToString()+(!String.IsNullOrEmpty(location)?"locations/"+location:"")
};
var resp = client.TranslateText(rq);

Error appears with locations/global, locations/us-central1 and without them. Also tried to remove google.cloud.translation.v3 reference and translate through WebRequests to https://translate.googleapis.com/v3/projects/.../locations/...:translateText

var request = new GoogleTranslateRequest()
{
    contents = lines.ToList(),
    targetLanguageCode = To,
    sourceLanguageCode = From
};
var json = JsonConvert.SerializeObject(request);
var wq = HttpWebRequest.Create(uri);
wq.Headers.Add("Authorization", headerValue);
wq.Method = "POST";
wq.ContentType = "application/json";
using (var stream = wq.GetRequestStream())
{
   using (var streamWriter = new StreamWriter(stream))
    {
        streamWriter.Write(json);
    }
}

This code gives me another error:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.TlsStream.CallProcessAuthentication(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at Translation.GoogleTranslatorAdapter.doTranslate(String[] lines)

I thought this error occurs because of 'https' and security protocols, and tried to set ServicePointManager.SecurityProtocol to TLS1.0, TLS1.1, TLS1.2, SSL3, and combinations of them, but it didn't help. This error occurs on Windows Server 2016 in a closed network, which uses proxy to connect to Google services. Now I don't have any ideas how to debug this error, but if you have any, I'd be glad to hear them out.

P.s. sorry for bad english, ready to answer any questions

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum