The most likely scenario is simply some issue is resetting the error code or Xojo bugged it internally. The only thing that i know of can cause error code 0 is it not even being set, or the actual code is being “reset” by something.
That is ofcourse if this uses winsock internally:
https://docs.microsoft.com/nl-nl/windows/win32/api/winsock/nf-winsock-wsagetlasterror