amt2 = AMTInstanceFactory.CreateEX(ci2); // this also succeeds!!
if (amt2 != null)
Console.WriteLine("Second connection ok");
amt2 = null;
Note: I could only reproduce the issue with digest and server TLS, doesn't happen if server TLS is not enabled, and I did not try yet with Kerberos or with mutual TLS.
Note 2: if I stay in a break point long enough before the amt2 = AMTInstanceFactory.CreateEX(ci2) command (this "long enough" varies from attempt to attempt), the CreateEX fails, like expected. So it seems to have something to do with cleaning up the old connection..