New Animation clip blocks player rotation

Hi!

I have a prefab gameobject with a playermovement script and it has a flip function below.
The function works fine and I have had a few animation clips on it for some time.
However, recently I tried adding a new clip with keyframes that adjusts the player’s rotation in a while that makes it look like it is spinning.

After making this new clip, my character no longer flips.
I tried removing all the keyframes in my animation clip and it went back to normal.
Is there any reason why adding a new animation clip would block my player from flipping?

Any help would be really appreciated as I am quite new to Unity!
Thanks

private void flip()
    {
        facingRight = !facingRight; // updates facing direction

        Vector3 flipped = transform.localScale;
        flipped.z *= -1f;
        transform.localScale = flipped;

        transform.Rotate(0, 180, 0);

    }

Make sure to stop the animator from continuing the animation. that way the player can resume control of the player object.

Okay I never found out what the actual underlying bug was, but a fix that I did was just to change my animation clip from changing the player’s rotation, to changing the player’s X-axis scale instead. This seems to save solved the problem at least for now.