When you gather all the namespaces in the scene, make sure you avoid the Maya built-in namespaces. Then start removing, deepest first. I usually use this to clean a scene after I have imported all references. If you still have references in the scene, this may cause unwanted object renames. In that case, proceed with caution.