This is likely related to: https://tracker.phpbb.com/browse/PHPBB3-13500
Assume we have two extensions A and B, where A has migrations that depend on migrations in B.
We now install both extensions.
If we then uninstall B again and delete the data, the migrations from A will also be removed, even though we never uninstalled or deactivated that extension.
I would expect the uninstall to fail in this case, or not remove the migrations which A depends upon.
I have created two small demo extensions depending on each other which demonstrate this behavior. The extension "thisdepends" has migrations which depend on migrations in "alldependsonthis".