Button doesn't disappear when deactivating its parent / grandparent

I’m trying to write a very simple splash page UI with a hierarchy like this:

MainMenu (an empty game object) >
Canvas > TextMeshProButton

I want clicking the button to deactivate the ‘MainMenu’ grandparent object in the hierarchy, hiding its child canvas and the button itself. To do this, I’m providing the MainMenu object reference to the Button’s OnClick() callback and calling ‘GameObject.SetActive’ to false when clicked.

My problem is that when I click the button, I can see the MainMenu hierarchy get grayed out in the editor, but the play button continues to display with its Highlighted color and doesn’t disappear. It does finally go away if
I change the display resolution while still in play mode (maybe forcing a refresh?), but I can’t figure out why deactivating the MainMenu wouldn’t it to refresh in the same way.

Anyone know what I’m doing wrong?

Ah, figured it out. Somehow the Clear Flags setting on my Camera was set to “Don’t Clear.” Even calling Destroy(gameObject) on my Button wasn’t making it disappear. Setting Clear Flags: “Solid Color” fixed the problem.