The documentation for the method is: "Encode this message as ASN.1 DER, appending it to the provided byte vector". The method then creates a SliceWriter that writes to the start of the vector. This creates problems when more than two entities need to be encoded into a vector (e.g. an X.509 certificate chain).
Is this behavior expected? I'll be happy to submit a PR.