Character(npc) spins fast around itself before facing right direction

As you mentioned, the “shortest direction.”

-90 degrees is also +270. Since your process hasn’t accounted for that, it will sometimes spin the long way around.