I think this happens during every XenForo upgrade on the upgrade/complete action, since that step reactivates Code Event Listeners and runs any that occur after reactivation. However, Code Events that occurred before reactivation aren't triggered as normally (like init_dependencies), which leads to unexpected results. The stack trace is remarkably unhelpful for some reason, providing no clear information as to where or why the error occurred, and refreshing upgrade/complete does not reproduce the error.
It may be resolved with a small change to the database controller: make it not expect that DB_Controller::ready was already fired by the calling script, and fire it automatically whenever ::get_instance is called and failed. This might seem obvious from an outside perspective, but when VaultWiki is implemented as a separate script (as in vBulletin < 5 and XenForo prior to VW4B5), it is possible to call ::ready before the software has actually created its database connection, which at one point had lead to the same error message we have here.
I will attempt now to see if this change resolves anything, but it may require multiple full upgrades since the error only occurs on upgrade/complete the first time it is loaded.