50405: Routing layer timed out
routing_layer_timed_outAbly's routing layer did not receive a response from the service handling the request within the time allowed, so the request was abandoned. 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. A timed-out publish may still have been processed, but Ably SDKs make REST publishes idempotent by default, so their retries cannot duplicate a message. To get the same guarantee when publishing over the REST API directly, set an ID on the message.
Why it happens
The service was slow to respond, typically because it was under load or the operation itself was slow to complete.
What you'll see
The error is reported with code 50405 and HTTP status 504. The message is Ably's routing layer was unable to service this request (gateway timeout), ending with the request ID (reqID).