Well, it isnt really a glitch, it's just something hampa put in the game for some reason.
It's a rule, left hand grabs first, so when you grab each others hands then the right hand will be grabbed and your left hand will grab his hand. It's the same thing that causes the problem of a sudden self grab while you thought you was grabbing a hand.
Answer to your question, you cant solve it.