Elbow 180 Flip Issue


I’m trying to figure out how to make animations and have run into a problem that I would like to understand.
Here’s a short clip to demonstrate the issue:

Basically, I adjust the hand position a little bit and the elbow will flip 180 degrees.
I’ve tried pinning the elbows rotation.
Any idea what would cause that?

Thank you.