There was indeed a case of mixed synchronous and deferred call of `next()` within `switchToDocument`. This is now fixed by da5fff890da8146b5fd0e9065587de8ed45725bc