Win 7 64bit
I don't know how it determines which keyframes to remove but basically when you try to overwrite keyframes (with the AutoMerge Keyframes option enabled) both of the keys at the new frames are just removed.
It only happens when there is a key at the "new" frame, unselected (I assume, based on the information for a recent change for fixing duplicate keys) I assume it's based on "how" the keys are selected (i.e. mouse click, curve select, select all, border select, etc);
press shift+D and drag the keys 27 frames forward. 5 keyframes will be removed.
(note: the keys were selected with border select)