With two instances of a sprite, but each instance having different frames.
You can't compare two instances like that! When you use an object in an expression like that, only the first instance is checked. So you are comparing it with itself.
If you want to compare two instances, you need to pick each instance separately. With a single object it's tricky, a common workaround is to use a family. Then you pick 1 instance of the sprite and 1 instance of the family, and compare Sprite.animationFrame=Family.animationFrame
Another option is to use IIDs:
Sprite(0).animationFrame=Sprite(1).animationFrame
But you need to be sure that there are only two instances on the layout.