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

#include "gdscript_compiler.h"
#include "gdscript.h"
#include "gdscript_byte_codegen.h"
#include "gdscript_cache.h"
#include "gdscript_utility_functions.h"
#include "core/config/engine.h"
#include "core/config/project_settings.h"
bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringName &p_name) {
	if (codegen.function_node && codegen.function_node->is_static) {
		return false;
	}
	if (_is_local_or_parameter(codegen, p_name)) {
		return false; 
	}
	return _is_class_member_property(codegen.script, p_name);
}
bool GDScriptCompiler::_is_class_member_property(GDScript *owner, const StringName &p_name) {
	GDScript *scr = owner;
	GDScriptNativeClass *nc = nullptr;
	while (scr) {
		if (scr->native.is_valid()) {
			nc = scr->native.ptr();
		}
		scr = scr->_base;
	}
	ERR_FAIL_COND_V(!nc, false);
	return ClassDB::has_property(nc->get_name(), p_name);
}
bool GDScriptCompiler::_is_local_or_parameter(CodeGen &codegen, const StringName &p_name) {