Honestly, I'm not a network guy, but I seem to remember a discussion reminiscent of this problem. If the firewall, or other intervening network device is filtering the connection, it may be removing or changing a packet which completes the close of a connection. I'd be suspicious of F5 or Palo Alto network devices, and I'm sure there are others.