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

err_line = -1;
	err_column = -1;
	error = "";
	parser = p_parser;
	main_script = p_script;
	const GDScriptParser::ClassNode *root = parser->get_tree();
	source = p_script->get_path();
	
	make_scripts(p_script, root, p_keep_state);
	main_script->_owner = nullptr;
	Error err = _populate_class_members(main_script, parser->get_tree(), p_keep_state);
	if (err) {
		return err;
	}
	err = _compile_class(main_script, root, p_keep_state);
	if (err) {
		return err;
	}
	if (has_static_data && !root->annotated_static_unload) {
		GDScriptCache::add_static_script(p_script);
	}
	return GDScriptCache::finish_compiling(main_script->path);
}
String GDScriptCompiler::get_error() const {