50205: Routing layer could not reach the service
routing_layer_connection_refusedAbly's routing layer could not open a connection to the service that should have handled the request, so the request was not completed. The condition is usually transient.
What you should do
Usually nothing: Ably SDKs retry this automatically, switching to a fallback endpoint if it keeps happening. If you call the REST API directly, retry after a short delay, increasing the delay if it recurs. If it persists for more than a few minutes, contact Ably support with the request ID from the message.
Why it happens
The service was not accepting connections at that moment, typically because it was restarting or being taken out of service while traffic was still being directed to it.
What you'll see
The error is reported with code 50205 and HTTP status 502. The message is Ably's routing layer was unable to service this request (bad gateway), ending with the request ID (reqID).