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

push_error(R"*(Cannot use shorthand "get_node()" notation ("$") on a class that isn't a node.)*", p_get_node);
	}
	mark_lambda_use_self();
	p_get_node->set_datatype(result);
}
GDScriptParser::DataType GDScriptAnalyzer::make_global_class_meta_type(const StringName &p_class_name, const GDScriptParser::Node *p_source) {
	GDScriptParser::DataType type;
	String path = ScriptServer::get_global_class_path(p_class_name);
	String ext = path.get_extension();
	if (ext == GDScriptLanguage::get_singleton()->get_extension()) {
		Ref<GDScriptParserRef> ref = get_parser_for(path);
		if (ref.is_null()) {
			push_error(vformat(R"(Could not find script for class "%s".)", p_class_name), p_source);
			type.type_source = GDScriptParser::DataType::UNDETECTED;
			type.kind = GDScriptParser::DataType::VARIANT;
			return type;
		}
		Error err = ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED);
		if (err) {
			push_error(vformat(R"(Could not resolve class "%s", because of a parser error.)", p_class_name), p_source);
			type.type_source = GDScriptParser::DataType::UNDETECTED;
			type.kind = GDScriptParser::DataType::VARIANT;
			return type;
		}
		return ref->get_parser()->head->get_datatype();
	} else {
		return make_script_meta_type(ResourceLoader::load(path, "Script"));
	}
}
void GDScriptAnalyzer::reduce_identifier_from_base_set_class(GDScriptParser::IdentifierNode *p_identifier, GDScriptParser::DataType p_identifier_datatype) {