The socket drag opperator stores the index of the last picked socket into RNA in case the user mouse cursor leaves the link while dragging.
This id is not uniqe which is why sometimes a link from an other node withthe same id is picked.
This patch changes the way the last picked link is stored and stores a pointer to the link directly into SpaceNode_Runtime instead.
{F9802243}
Video of the bug by @pablovazquez