Repository: godot
Issue: Singleton created in GDExtension don't recieve any events: _input, _physics_process, _process, _ready, etc don't work
Labels: documentation,topic:gdextension

### Godot version

v4.1.2.stable.official [399c9dc39]

### System information

Godot v4.1.2.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 650 (NVIDIA; 30.0.14.7430) - 13th Gen Intel(R) Core(TM) i5-13400 (16 Threads)

### Issue description

Singleton created by memnew in GDExtension and registered by Engine::get_singleton()->register_singleton don't receive any events, any of virtual methods won't called, also don't shown in Node Tree Viewer, near "root" node, but all other functions seems work, singleton available from any GDScript.

### Steps to reproduce

1. Setup "godot-cpp" module follow official docs:
https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html
2. Create Foo.cpp use given source code below, compile and assemble extension use scons.
3. Create simple project that use given extension.
4. Check console.

### Minimal reproduction project

Foo.cpp:
```cpp
#include <gdextension_interface.h>
#include <godot_cpp/core/defs.hpp>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/godot.hpp>
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/input_event.hpp>
#include <godot_cpp/classes/node.hpp>
#include <godot_cpp/variant/utility_functions.hpp>

using namespace godot;

class Foo : public Node {
	GDCLASS(Foo , Node );

protected:
	static void _bind_methods();

public:
	virtual void _enter_tree() override { UtilityFunctions::print("_enter_tree"); }
	virtual void _exit_tree() override { UtilityFunctions::print("_exit_tree"); }
	virtual void _input(const Ref<InputEvent> &event) override { UtilityFunctions::print("_input"); }
	virtual void _physics_process(double delta) override { UtilityFunctions::print("_physics_process"); }
	virtual void _process(double delta) override { UtilityFunctions::print("_process"); }
	virtual void _ready() override { UtilityFunctions::print("_ready"); }
	void say_hello() { UtilityFunctions::print("Hello from Foo"); }

	virtual ~Foo() override {}
	Foo() : Node() {}
};

Foo* foo = nullptr;

void initialize_example_module(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; }
		
	ClassDB::register_class<Foo>();
	foo = memnew(Foo);
	Engine::get_singleton()->register_singleton("GlobalFoo", foo);
}
void uninitialize_example_module(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; }

	Engine::get_singleton()->unregister_singleton("GlobalFoo");
	memdelete(foo);
}
void Foo::_bind_methods() {
	ClassDB::bind_method(D_METHOD("say_hello"), &Foo::say_hello);
}

extern "C" {
	GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
		godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);

		init_obj.register_initializer(initialize_example_module);
		init_obj.register_terminator(uninitialize_example_module);
		init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);

		return init_obj.init();
	}
}
```

test_scene.gd:
```
extends Node3D

func _ready():
	GlobalFoo.say_hello()
```

Output:
```
Godot Engine v4.1.2.stable.official.399c9dc39 - https://godotengine.org
Vulkan API 1.2.175 - Forward Mobile - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 650
 
Hello from Foo
```