I had this exact same issue! I originally tried it the same way as you and got errors. Then someone recommended that I try using anglediff instead, and for reasons unknown to me that worked while comparing angles normally did not. I did this:
First, add a variable to whatever is moving called 'Angle Tracker' or the like. Make it update every tick to that object's Bullet Angle of Motion.
-For each + Bullet Speed 0 (inverted):
-anglefiff(Object.AngleTracker,0) < 45: Set animation to 'right'
-anglefiff(Object.AngleTracker,90) < 45: Set animation to 'down'
-anglefiff(Object.AngleTracker,180) < 45: Set animation to 'left'
-anglefiff(Object.AngleTracker,270) < 45: Set animation to 'up'
-Object Bullet Speed = 0: Set animation frame to 0.
And there you have it! Hope that helps.