Ably 40160 on a token-auth client means the token itself lacks the capability, so reconnecting will not help. Update your token-issuing code to include the capability (publish, subscribe, history, presence, whatever the operation needs) and issue a fresh token.

Context: From Ably's official error-code docs for 40160 (capability denied). Every operation needs a capability on the channel or resource, and a client on token auth keeps the capabilities baked into that token until it is refreshed. Reconnecting with the same cached token changes nothing; the fix is to update the code that issues tokens so they include the needed capability. API-key clients pick up changes on their next connection, token clients do not.