### Godot version

4.0 RC 3

### System information

Macbook m1

### Issue description

If I normally use:
```
Skeleton2D.new()
```

if works.

If I use:
```
@export_group("Skeleton2D")
...
Skeleton2D.new()
```

I get error: `Invalid call. Nonexistent function 'new' in base 'Nil'.`

### Steps to reproduce

- Run a script where you have `@export_group` with same name as a node class name that you use `.new()` on.

```
extends Node2D
class_name Test

@export_group("Skeleton2D")

# Called when the node enters the scene tree for the first time.
func _ready():
	var skeleton = Skeleton2D.new()


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass
```

### Minimal reproduction project

[BugNew.zip](https://github.com/godotengine/godot/files/10818936/BugNew.zip)

_set_error("The class '" + p_script->name + "' shadows a native class", p_class);
			return ERR_ALREADY_EXISTS;
		}
	}
	GDScriptDataType base_type = _gdtype_from_datatype(p_class->base_type, p_script);
	int native_idx = GDScriptLanguage::get_singleton()->get_global_map()[base_type.native_type];
	p_script->native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
	ERR_FAIL_COND_V(p_script->native.is_null(), ERR_BUG);
	
	switch (base_type.kind) {
		case GDScriptDataType::NATIVE:
			
			break;
		case GDScriptDataType::GDSCRIPT: {
			Ref<GDScript> base = Ref<GDScript>(base_type.script_type);
			if (base.is_null()) {
				return ERR_COMPILATION_FAILED;
			}
			if (main_script->has_class(base.ptr())) {
				Error err = _populate_class_members(base.ptr(), p_class->base_type.class_type, p_keep_state);
				if (err) {
					return err;
				}
			} else if (!base->is_valid()) {
				Error err = OK;
				Ref<GDScript> base_root = GDScriptCache::get_shallow_script(base->path, err, p_script->path);
				if (err) {
					_set_error(vformat(R"(Could not parse base class "%s" from "%s": %s)", base->fully_qualified_name, base->path, error_names[err]), nullptr);
					return err;
				}