Setting correct aim_pitch for nextbot

So, I create function which can set pose parameters for nextbot, so that he turns his upper body to a vector. But I have trouble: aim_yaw of nextbot sets correctly, but aim_pitch sets everytime higher then vector position.

For a example: if vector is enemy position and enemy is close, then nextbot will turn his body upward