How to fix this code for opening a menu?

Help me please. I wanted to implement the function of opening the menu using the escape key, but when starting the game and starting a new game, instead of the gameplay scene in which the game should be located in the future (where the menu was accessed using the escape button), the following error appeared: Invalid call. Nonexistent function ‘hide’ in base ‘Node’. What to do?
Here is the code for all three of my scripts: main menu, gameplay and menu:

extends Label


func _ready():
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass


func _on_button_pressed():
	get_tree().change_scene_to_file("res:// Gameplay.tscn")


func _on_texture_button_pressed():
	get_tree().change_scene_to_file("res:// Gameplay.tscn")
extends Node

var escape_panel

func _ready():
	escape_panel = preload("res://Escape.tscn").instantiate()
	escape_panel.QueueFree()
	add_child(escape_panel)

func _input(event):
	if event is InputEventKey:
		if event.scancode == KEY_ESCAPE and event.pressed:
			toggle_escape_panel()


func toggle_escape_panel():
	if escape_panel.visible:
		escape_panel.queue_free()
	else:
		escape_panel = preload("res://Escape.tscn").instance()
		add_child(escape_panel)
extends Panel

func _ready():
	pass

func _on_QuitToMenu_pressed():
	get_tree().change_scene_to_file("res://control.tscn")
	print("Quitting to menu")

func _on_Settings_pressed():
	print("Opening settings")

func _on_Resume_pressed():
	resume_game()

func resume_game():
	self.hide()
	get_tree().paused = false
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

I’m not to good my self but I suggest you use a input map instead of finding the key. The reason I say this is because it’s easier to change and allows for multiple platform compatibility. This is a good video for input maps https://www.youtube.com/watch?v=ngHbAmN062c.

This looks bad you created the panel and queue free it immediately before adding it as child, why? … although that isn’t the right function?

Otherwise not sure why you are getting that hide error.