### 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 HashSet<int> &get_unsafe_lines() const { return unsafe_lines; }
	int get_last_line_number() const { return current.end_line; }
#endif
	GDScriptParser();
	~GDScriptParser();
#ifdef DEBUG_ENABLED
	class TreePrinter {
		int indent_level = 0;
		String indent;
		StringBuilder printed;
		bool pending_indent = false;
		void increase_indent();
		void decrease_indent();
		void push_line(const String &p_line = String());
		void push_text(const String &p_text);
		void print_annotation(const AnnotationNode *p_annotation);
		void print_array(ArrayNode *p_array);
		void print_assert(AssertNode *p_assert);
		void print_assignment(AssignmentNode *p_assignment);
		void print_await(AwaitNode *p_await);
		void print_binary_op(BinaryOpNode *p_binary_op);
		void print_call(CallNode *p_call);
		void print_cast(CastNode *p_cast);
		void print_class(ClassNode *p_class);
		void print_constant(ConstantNode *p_constant);
		void print_dictionary(DictionaryNode *p_dictionary);
		void print_expression(ExpressionNode *p_expression);
		void print_enum(EnumNode *p_enum);
		void print_for(ForNode *p_for);
		void print_function(FunctionNode *p_function, const String &p_context = "Function");