Problems with the player's rotation value

Alright, so I made this blueprint code to try to make a “dash” mechanic when the player turns around 180º in the actionRPG template. The code works mostly fine, but it has some difficulties with the turning around part if it is performed at the angle where the yaw is close to zero. I’ve been trying to solve this problem for an hour and a half right now but I think I ran out of ideas…
Any ideas on how to approach this?

Also, here are some screenshots of the BP in question:



Thanks in advance!