Is it correct to delete a button that opens a section, when the section is open?

In a particular scenario, I have a button in the main window of application that, when pressed, opens a specific "command" section. When this section is open, is it correct to delete the button that opens the section (and make it visible again when the section will be closed), or is it better to maintaine it visible (with no effect)?

We have not graphical constraints: I am asking myself if there is a general UI-best practice and intuitive answer for this question, or it depends (if so, by what).

Many thanks.