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

{
				
				const GDScriptParser::ClassNode *base_class = codegen.class_node;
				while (base_class != nullptr) {
					if (base_class->has_member(identifier)) {
						const GDScriptParser::ClassNode::Member &member = base_class->get_member(identifier);
						if (member.type == GDScriptParser::ClassNode::Member::FUNCTION || member.type == GDScriptParser::ClassNode::Member::SIGNAL) {
							
							GDScriptCodeGenerator::Address temp = codegen.add_temporary(); 
							GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);
							gen->write_get_named(temp, identifier, self);
							return temp;
						}
					}
					base_class = base_class->base_type.class_type;
				}
				
				GDScript *scr = codegen.script;
				GDScriptNativeClass *nc = nullptr;
				while (scr) {
					if (scr->native.is_valid()) {
						nc = scr->native.ptr();
					}
					scr = scr->_base;
				}
				if (nc && (ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
					
					GDScriptCodeGenerator::Address temp = codegen.add_temporary(); 
					GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);
					gen->write_get_named(temp, identifier, self);