### 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)

return temp;
				}
			}
			
			if (GDScriptLanguage::get_singleton()->get_global_map().has(identifier)) {
				
				
				HashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list();
				if (autoloads.has(identifier) && autoloads[identifier].is_singleton) {
					GDScriptCodeGenerator::Address global = codegen.add_temporary(_gdtype_from_datatype(in->get_datatype(), codegen.script));
					int idx = GDScriptLanguage::get_singleton()->get_global_map()[identifier];
					gen->write_store_global(global, idx);
					return global;
				} else {
					int idx = GDScriptLanguage::get_singleton()->get_global_map()[identifier];
					Variant global = GDScriptLanguage::get_singleton()->get_global_array()[idx];
					return codegen.add_constant(global);
				}
			}
			
			if (ScriptServer::is_global_class(identifier)) {
				const GDScriptParser::ClassNode *class_node = codegen.class_node;
				while (class_node->outer) {
					class_node = class_node->outer;
				}
				Ref<Resource> res;
				if (class_node->identifier && class_node->identifier->name == identifier) {
					res = Ref<GDScript>(main_script);
				} else {
					String global_class_path = ScriptServer::get_global_class_path(identifier);