So no smoking gun.
Seems like the connection between relay and B just dies.
Maybe your tcp stack has very short keep alives/statefull firewall with a short timeout?
I guess you could set -ping-interval=10s
on the relay and see if that helps, this will make sure there are some messages exchanged between the two every 10 seconds.
It’s a bit sad that a connection to the relay for the purposes of accepting new connections breaking, breaks existing connections, but I guess that’s just how the current architecture works, and it would be non-trivial to do something else.
Also, I guess it sort of makes sense, as it helps recover from cases where the relay genuinely disappeared, allowing quicker detection of dead connections.