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

UNDETECTED, 
			INFERRED, 
			ANNOTATED_EXPLICIT, 
			ANNOTATED_INFERRED, 
		};
		TypeSource type_source = UNDETECTED;
		bool is_constant = false;
		bool is_read_only = false;
		bool is_meta_type = false;
		bool is_pseudo_type = false; 
		bool is_coroutine = false; 
		Variant::Type builtin_type = Variant::NIL;
		StringName native_type;
		StringName enum_type; 
		Ref<Script> script_type;
		String script_path;
		ClassNode *class_type = nullptr;
		MethodInfo method_info; 
		HashMap<StringName, int64_t> enum_values; 
		_FORCE_INLINE_ bool is_set() const { return kind != RESOLVING && kind != UNRESOLVED; }