The `NodeList` is from cloned select element and the issue happens after cloned select element get GC'ed which also clears it's `childNodes`, https://searchfox.org/mozilla-central/rev/aba472751e24763d0c18bae8408e9d7106e9acea/dom/base/nsINode.cpp#125,140. And it looks like the console.log calls prevents cloned element being GC'ed, so we don't see this issue.
Bug 1551425 Comment 9 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The `NodeList` is from cloned select element and the issue happens after cloned select element get GC'ed which also clears it's `childNodes`, https://searchfox.org/mozilla-central/rev/aba472751e24763d0c18bae8408e9d7106e9acea/dom/base/nsINode.cpp#125,140. And it looks like the console.log calls prevents cloned element being GC'ed, so we don't encounter the issue.