"Variable Not Assigned" error but it is assigned

I have a pause menu screen in my game, and I have made it so that when you click the “Main Menu” button, it pops up with a panel saying “Progress will be lost. Are you sure” and two buttons - one to cancel and one to continue to the main menu. All the script does is when the “main menu” button on the pause screen is clicked, the progressLostPanel GameObject is SetActive(true) and then when you click “cancel”, it’s progressLostPanel.SetActive(false). Theoretically, that should just close the panel, right? Apparently not. It pops up fine so the object is assigned and works, however when I press “cancel”, I get an error saying that the game object progressLostPanel has not been assigned. I’m super confused because it is assigned and even works except for the cancel button (the “back to main menu” button even works properly as well). Below are my functions and some screen shots.

public void ShowProgressLostPanel()
{
    progressLostPanel.SetActive(true);
    Debug.Log("Progress Panel Showing!");
}

public void HideProgressLostPanel()
{
    progressLostPanel.SetActive(false);
    Debug.Log("Progress Panel Hidden!");
}

173413-objectassigned.png

Oh my gosh… I think I just fixed it. For some reason, all I had to do was apply the changes to the prefab and it works now… What a weird bug.