Replaced body part behaves incorrectly with similar vertex groups and weight paint

Hi!

After replacing a head of the character and assigning similar vertex groups for head and neck + painting their weights, when rotating head bone in pose mode it looks squashed unlike original head.