### Godot version

4.1.3

### System information

Linux

### Issue description

I'm trying to make an editor plugin on Rust:

```rust
#[derive(GodotClass)]
#[class(tool, editor_plugin, init, base=EditorPlugin)]
pub struct MyEditorPluginBase {}
```

But due to some limitations, I still have to use GDScript for some specific things.

So I tried to make a subclass of this Rust class:

```gdscript
@tool
class_name MyEditorPlugin
extends MyEditorPluginBase
```

This would work if `MyEditorPluginBase` was a GDScript class, but since it's a GDExtension class in my case, it doesn't work:

> Unable to load addon script from path: 'res://addons/my_addon/my_editor_plugin.gd' Base type is not EditorPlugin.

But it obviously **IS** EditorPlugin!

![godot-editorplugin-docs](https://github.com/godotengine/godot/assets/3236464/4665deeb-30f0-45cd-bfff-56101b9d4875)

![godot-editorplugin](https://github.com/godotengine/godot/assets/3236464/b1b6ecb4-de22-4abd-91a3-e180691f67ee)

If I understand correctly, this behavior is caused by this function, which checks some mysterious "instance base type" instead of real inheritance:

https://github.com/godotengine/godot/blob/fa4a65387ea41506ecc519fc61a06da110dce51c/editor/editor_node.cpp#L3456-L3458

https://github.com/godotengine/godot/blob/fa4a65387ea41506ecc519fc61a06da110dce51c/modules/gdscript/gdscript.cpp#L260-L263

Since the [documentation](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html#the-script-file) doesn't say that the script must be a **direct** subclass of EditorPlugin (and an indirect subclass works fine in GDScript), I interpret this behavior as a Godot bug.

### Steps to reproduce

See above

### Minimal reproduction project

[gdext_editor_plugin_test.zip](https://github.com/godotengine/godot/files/13451014/gdext_editor_plugin_test.zip)
}
	if (!script.is_empty()) {
		Ref<Script> script_res = ResourceLoader::load(script);
		ERR_FAIL_COND_V_MSG(script_res.is_null(), false, "Can't load script: " + script);
		if (check_only) {
			if (!script_res->is_valid()) {
				OS::get_singleton()->set_exit_code(EXIT_FAILURE);
			} else {
				OS::get_singleton()->set_exit_code(EXIT_SUCCESS);
			}
			return false;
		}
		if (script_res->can_instantiate()) {
			StringName instance_type = script_res->get_instance_base_type();
			Object *obj = ClassDB::instantiate(instance_type);
			MainLoop *script_loop = Object::cast_to<MainLoop>(obj);
			if (!script_loop) {
				if (obj) {
					memdelete(obj);
				}
				OS::get_singleton()->alert(vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", script));
				ERR_FAIL_V_MSG(false, vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", script));
			}
			script_loop->set_script(script_res);
			main_loop = script_loop;
		} else {
			return false;
		}
	} else { /
		if (!editor && !ClassDB::class_exists(main_loop_type) && ScriptServer::is_global_class(main_loop_type)) {