Code not working on new update

Hey, so i have this script that is animating my menu on button press. In version 5.4.2 it worked perfectly in the inspector and in android build. However since updating to 5.6.2 this still works in the inspector but no longer works in the android build. I’ve tested a few things and the button press is still working it’s just the function doesn’t seem to be working any longer. Is there something that’s changed or a better way to handle this?

public bool isVisible;
    public RectTransform optionsPanel;
    
    //>

    void Awake ()
    {
        isVisible = false;
	}

    public IEnumerator MoveMenu(RectTransform panel, Vector2 position, float speed)
    {
        Vector2 currentPos = panel.anchoredPosition;
        float t = 0f;
        while (t < 1)
        {
            t += Time.deltaTime / speed;
            panel.anchoredPosition = Vector2.Lerp(currentPos, position, t);
            yield return null;
        }
    }

    public void ToggleMenu ()
    {
        if(!isVisible && optionsPanel.anchoredPosition.x == -650)
        {      
            StartCoroutine(MoveMenu(optionsPanel, new Vector2(0f, 0f), 0.2f));
            isVisible = true;
        }
        else if(isVisible && optionsPanel.anchoredPosition.x == 0)
        { 
            StartCoroutine(MoveMenu(optionsPanel, new Vector2(-650f, 0f), 0.2f));
            isVisible = false;
        } 
    }

ToggleMenu() is what’s being called OnClick()

Still curious about why this doesn’t work anymore but the fix is to remove the check for position in ToggleMenu() for anyone who wants the code.

public void ToggleMenu ()
         {
             if(!isVisible)
             {      
                 StartCoroutine(MoveMenu(optionsPanel, new Vector2(0f, 0f), 0.2f));
                 isVisible = true;
             }
             else if(isVisible)
             { 
                 StartCoroutine(MoveMenu(optionsPanel, new Vector2(-650f, 0f), 0.2f));
                 isVisible = false;
             } 
         }