This is not a bug, this is intended behavior. The X is not a cancel button, it’s a clear button. To cancel this selection just press esc or click somewhere else within the properties window.
That being said, it might make sense to hide the X on the Parent property setter, since I can’t think of a use case where you actually want to do this since it deselects the object afterwards, meaning it’s equivalent to deleting the object.