Namespace collision happens when the new Attribute will require two different namespace URLs wit the same prefix to be in scope for an Element. Setting an attribute position to a new attribute may cause a namespace collision if the new attribute has the same prefix, but different URL, as an existing item in the Element.
But, if the only collision is with the attribute that is being replaced, then there is no collision.... but the current checkNamespaceCollision does not take the replaceing-the-collision-attribute in to consideration, and it should.