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

if (type_source == UNDETECTED || p_other.type_source == UNDETECTED) {
				return true; 
			}
			if (type_source == INFERRED || p_other.type_source == INFERRED) {
				return true; 
			}
			if (kind != p_other.kind) {
				return false;
			}
			switch (kind) {
				case VARIANT:
					return true; 
				case BUILTIN:
					return builtin_type == p_other.builtin_type;
				case NATIVE:
				case ENUM: 
					return native_type == p_other.native_type;
				case SCRIPT:
					return script_type == p_other.script_type;
				case CLASS:
					return class_type == p_other.class_type || class_type->fqcn == p_other.class_type->fqcn;
				case RESOLVING:
				case UNRESOLVED:
					break;
			}
			return false;
		}
		bool operator!=(const DataType &p_other) const {