From the Server perspective, the connection was closed by the Client (this is the error 38).
However, as suggested by the exception you received, from the Client perspective, the connection was closed by the Server.
We should clarify if the two messages refer to the same or different connections.
Did you receive the exception upon a subscribe call or through onFailure on the connection listener?

The subsequent "sync error" may be just a consequence:
When the Client finds a broken connection, it still tries to inform the Server that the session is no longer needed with a "destroy" request.
In this case, the session has been already closed, because the Server has noticed the connection break, hence the error.
However, the "sync error" demonstrates that the client-server connectivity is still working after the issue.