This succeeds in normal Firefox due to `QueryInterface(Ci.nsIWindowsShellService)` having likely been called on the `nsIShellService` prior to this call, which populates the root `nsIShellService` JavaScript object with the queried interface methods. In Firefox Background Tasks the relevant `QueryInterface` is unlikely to be called ahead of time, resulting in an exception.
Original Revision: https://phabricator.services.mozilla.com/D221540
Differential Revision: https://phabricator.services.mozilla.com/D222325