Extensions can specify namespace IDs in extension.json, see https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#namespaces. These IDs however do not just act as defaults. They cannot be overwritten. That means that it is not possible to install an extension that has a namespace in extension.json that is already used on the wiki.
Instead, the ID given in extension.json should act as a default. Overriding it in LocalSettings.php by setting an entry in $wgNamespaces should be possible.