Idk why but when I press a retry button, it doesn't reload the scene

Godot Version

4.2.2

Question

I wanted to make a retry button to reload the whole scene so that we can play again.
I’ve added:
func _on_retry_button_pressed():
get_tree().reload_current_scene()

But when I press the button, it do nothing
It’s maybe really stupid but yeah, I’m stuck on this

Would you please show us the code for your script? What’s in “reload current scene”?

extends Node2D

func spawn_mob():
var new_mob = preload(“res://mob.tscn”).instantiate()
%PathFollow2D.progress_ratio = randf()
new_mob.global_position = %PathFollow2D.global_position
add_child(new_mob)

func _on_timer_timeout():
spawn_mob()

func _on_player_health_depleted():
%GameOverScreen.visible = true
get_tree().paused = true

func _on_retry_button_pressed():
get_tree().reload_current_scene()

This is the script, the game script