Why do gdextensions unload?

Godot Version

4.3 stable

Question

Hi all. I’m working on supporting gdextensions in godot-global-project. It seems that when the editor first loads, and I manually call GDExtensionManager.load_extension(), it gets unloaded by the next frame, and doesn’t appear in GDExtensionManager.get_loaded_extensions().

However, if I wait at least 2 frames before loading, the extension stays loaded and works fine. Does anyone know why it might be unloading, and why 2 frames is need? I might stick with waiting 2 frames, but without knowing why, it could be unreliable and break for users

For context, I used both a test gdextension, and the official git plugin. They both work completely fine when loaded later

Edit: I noticed more weird behavior. It seems gdextensions unload even when they editor loses focus and then regains it. Maybe its a resource scanning thing, where it clears and reloads all extensions every now and then?