Otherwise I cannot understand how, following the corresponding definitions of HTML and Selectors, document.querySelector(':scope') can return document.documentElement (:root), which is apparently expected (wpt.fyi, WPT).
In some contexts, selectors are matched with respect to one or more scoping roots, such as when calling the querySelector() method in [DOM]. The :scope pseudo-class represents this scoping root [...]
https://drafts.csswg.org/selectors-4/#the-scope-pseudo
My understanding is that document is passed as one of the scoping roots, and that none of the candidate elements match :scope since none is included in scoping roots.