Revert "cannot overwrite registered factory in PolymorphicDomainObjectContainer"

This reverts commit dd9b9653e43ce1cb0f93191c3877be83926d91af.

The change causes e.g. MixedLegacyAndComponentJvmPluginIntegrationTest to fail. need to fix that first
temporary ignore testcase