### Godot version

ef025711a

### System information

ArchLinux x11

### Issue description

Accessing a scene unique node like this:
```gdscript
class_name Class extends Node
static func get_label() -> Label:
	return %label
```
and then accessing that class later:
```gdscript
func _ready() -> void:
	Main.get_label().text = "hello world"
```
causes a strange error when in the editor, and a normal error when run directly.
![image](https://user-images.githubusercontent.com/70787919/229785642-6aad4e31-6bd9-4eb5-bee4-7445b48a99bb.png)
```c++
ERROR: Node not found: "%label" (relative to "/root/main").
   at: get_node (scene/main/node.cpp:1364)
```
Instead of returning null.
As opposed to when using `get_node`:
```

SCRIPT ERROR: Cannot call method 'get_node' on a null value.
          at: get_label (res://main.gd:5)
SCRIPT ERROR: Invalid set index 'text' (on base: 'Nil') with value of type 'String'.
          at: _ready (res://control.gd:4)
```

### Steps to reproduce

Run mrp or follow outlined steps

### Minimal reproduction project

[bug.zip](https://github.com/godotengine/godot/files/11148287/bug.zip)

}
	if (class_exists(name)) {
		p_identifier->set_datatype(make_native_meta_type(name));
		return;
	}
	if (ScriptServer::is_global_class(name)) {
		p_identifier->set_datatype(make_global_class_meta_type(name, p_identifier));
		return;
	}
	
	
	if (ProjectSettings::get_singleton()->has_autoload(name)) {
		const ProjectSettings::AutoloadInfo &autoload = ProjectSettings::get_singleton()->get_autoload(name);
		if (autoload.is_singleton) {
			
			GDScriptParser::DataType result;
			result.kind = GDScriptParser::DataType::NATIVE;
			result.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
			if (ResourceLoader::get_resource_type(autoload.path) == "GDScript") {
				Ref<GDScriptParserRef> singl_parser = get_parser_for(autoload.path);
				if (singl_parser.is_valid()) {
					Error err = singl_parser->raise_status(GDScriptParserRef::INHERITANCE_SOLVED);
					if (err == OK) {
						result = type_from_metatype(singl_parser->get_parser()->head->get_datatype());
					}
				}
			} else if (ResourceLoader::get_resource_type(autoload.path) == "PackedScene") {
				if (GDScriptLanguage::get_singleton()->has_any_global_constant(name)) {
					Variant constant = GDScriptLanguage::get_singleton()->get_any_global_constant(name);
					Node *node = Object::cast_to<Node>(constant);