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

bool is_void_function = has_expected_type && expected_type.is_hard_type() && expected_type.kind == GDScriptParser::DataType::BUILTIN && expected_type.builtin_type == Variant::NIL;
		bool is_call = p_return->return_value->type == GDScriptParser::Node::CALL;
		if (is_void_function && is_call) {
			
			reduce_call(static_cast<GDScriptParser::CallNode *>(p_return->return_value), false, true);
		} else {
			reduce_expression(p_return->return_value);
		}
		if (is_void_function) {
			p_return->void_return = true;
			const GDScriptParser::DataType &return_type = p_return->return_value->datatype;
			if (is_call && !return_type.is_hard_type()) {
				String function_name = parser->current_function->identifier ? parser->current_function->identifier->name.operator String() : String("<anonymous function>");
				String called_function_name = static_cast<GDScriptParser::CallNode *>(p_return->return_value)->function_name.operator String();
#ifdef DEBUG_ENABLED
				parser->push_warning(p_return, GDScriptWarning::UNSAFE_VOID_RETURN, function_name, called_function_name);
#endif
				mark_node_unsafe(p_return);
			} else if (!is_call) {
				push_error("A void function cannot return a value.", p_return);
			}
			result.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
			result.kind = GDScriptParser::DataType::BUILTIN;
			result.builtin_type = Variant::NIL;
			result.is_constant = true;
		} else {
			if (p_return->return_value->type == GDScriptParser::Node::ARRAY && has_expected_type && expected_type.has_container_element_type()) {
				update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_return->return_value), expected_type.get_container_element_type());
			}
			if (has_expected_type && expected_type.is_hard_type() && p_return->return_value->is_constant) {