Rotating actor to opposite direction not working on the diagonal axis

Hello,

I am pretty new to Unreal Engine 5 and have been trying to learn through trying to develop small mechanics and try to understand how things work exactly.

On this project, I am using the Mobile game touch interface that is mapped to mouse inputs (x-axis and y-axis) to rotate an actor in the direction that is pressed. So far I have managed to achieve this. Here are the screenshots of my blueprint:

However, I have noticed that when the direction input is the opposite of a diagonal, the actor will not rotate to the new direction. This is only an issue with the diagonal axis, not with the x-axis or the y-axis. A video might explain this better:

Is this an issue I can resolve within the blueprint I have made, or Is there a better way that will not have this issue?