I assume the script in the screenshot is intended to be connected to the top-level GameHandler
node, but are you sure that's the case? I see other nodes in the scene tree with attached scripts...
Assuming the above script is attached to the top-level node, are you sure it's not unintentionally attached to other node(s) too?
On the surface, I'd expect the code to work as you intend if the script is attached to the top-level node (and only to that node)...