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

virtual void set_datatype(const DataType &p_datatype) { datatype = p_datatype; }
		virtual bool is_expression() const { return false; }
		virtual ~Node() {}
	};
	struct ExpressionNode : public Node {
		
		bool reduced = false;
		bool is_constant = false;
		Variant reduced_value;
		virtual bool is_expression() const override { return true; }
		virtual ~ExpressionNode() {}
	protected:
		ExpressionNode() {}
	};
	struct AnnotationNode : public Node {
		StringName name;
		Vector<ExpressionNode *> arguments;
		Vector<Variant> resolved_arguments;
		AnnotationInfo *info = nullptr;
		PropertyInfo export_info;
		bool is_resolved = false;
		bool is_applied = false;
		bool apply(GDScriptParser *p_this, Node *p_target);
		bool applies_to(uint32_t p_target_kinds) const;
		AnnotationNode() {