The client does not do anything particularly clever. It tries two ways of connecting each of which may fail.
If there is a way to detect IPv6 vs. IPv4 availability and preference, we would consider a PR but I somewhat doubt
it would be more reliable than catching an exception.
This is not a problem I'd spend any time on, to be honest. There are much bigger ones, including in the .NET client specifically.