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

String script_path;
	bool for_completion = false;
	bool panic_mode = false;
	bool can_break = false;
	bool can_continue = false;
	List<bool> multiline_stack;
	ClassNode *head = nullptr;
	Node *list = nullptr;
	List<ParserError> errors;
#ifdef DEBUG_ENABLED
	bool is_ignoring_warnings = false;
	List<GDScriptWarning> warnings;
	HashSet<GDScriptWarning::Code> ignored_warnings;
	HashSet<int> unsafe_lines;
#endif
	GDScriptTokenizer tokenizer;
	GDScriptTokenizer::Token previous;
	GDScriptTokenizer::Token current;
	ClassNode *current_class = nullptr;
	FunctionNode *current_function = nullptr;
	SuiteNode *current_suite = nullptr;
	CompletionContext completion_context;
	CompletionCall completion_call;
	List<CompletionCall> completion_call_stack;
	bool passed_cursor = false;
	bool in_lambda = false;
	bool lambda_ended = false; 
	typedef bool (GDScriptParser::*AnnotationAction)(const AnnotationNode *p_annotation, Node *p_target);
	struct AnnotationInfo {
		enum TargetKind {