Alright, OOjs UI v0.22.0 really is broken. The new code has a couple of bugs we missed, mostly related to closing windows. There's nothing wrong with the WindowInstance concept (and nothing we should need to fix in VE), they are just bugs.
I'll be submitting a few patches. We should probably release v0.22.1 today (although I'd be fine with applying local patches in MediaWiki and VisualEditor too).
This fixes the exception when closing an inspector.
I don't think the problem here was causing any visible issues, but it's still broken. I noticed this when writing the previous patch.
This fixes a test failure that James sneakily worked around with https://gerrit.wikimedia.org/r/#/c/356316/3/tests/ui/dialogs/ve.ui.FindAndReplaceDialog.test.js.