This isn't how it works in the browser, so this is a bug with the underlying return value of appendChild.
If a DocumentFragment has no childNodes, and it's appended to another element, the call to DOMElement::appendChild returns false, when it should actually return the appended DocumentFragment.