Deselecting a keyframe makes its FCurve selected and active. This causes another keyframe to be considered the Active Keyframe, namely the last-selected keyframe of the now-active curve. This behaviour is unintuitive, and inconsistent with the commit message in rB983ad4210b9e:
The active keyframe in the graph editor is treated similarly to the active vertex in the 3D view. It is the keyframe most recently selected with a single click, and it is always selected.
T81890 has an example file and steps to reproduce.
Another solution would be to decouple the active keyframe from the active FCurve. That would be a bigger change, though, and I think that with this small change things are behaving much better already.