### Godot version

4.0-rc6

### System information

Fedora 37, Mesa Intel ADL GT2

### Issue description

Code that works as expected at runtime fails with Nil references to (assigned) exported vars in the editor:

![tool_global_position_error](https://user-images.githubusercontent.com/364501/222031460-ffb1ecbd-5175-4a42-8470-25285ba5f821.png)


### Steps to reproduce

Try to access the `global_position` of a `Node3D` that's assigned to an exported var.

See that it works at runtime.

See that it errors in the editor with:

> Invalid get index 'global_position' (on base: 'Nil').

### Minimal reproduction project

[tool_test.zip](https://github.com/godotengine/godot/files/10856640/tool_test.zip)

}
EditorPropertyNodePath::EditorPropertyNodePath() {
	HBoxContainer *hbc = memnew(HBoxContainer);
	hbc->add_theme_constant_override("separation", 0);
	add_child(hbc);
	assign = memnew(Button);
	assign->set_flat(true);
	assign->set_h_size_flags(SIZE_EXPAND_FILL);
	assign->set_clip_text(true);
	assign->set_auto_translate(false);
	assign->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_assign));
	SET_DRAG_FORWARDING_CD(assign, EditorPropertyNodePath);
	hbc->add_child(assign);
	clear = memnew(Button);
	clear->set_flat(true);
	clear->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_clear));
	hbc->add_child(clear);
	scene_tree = nullptr; 
}
void EditorPropertyRID::update_property() {
	RID rid = get_edited_property_value();
	if (rid.is_valid()) {
		uint64_t id = rid.get_id();
		label->set_text("RID: " + uitos(id));
	} else {
		label->set_text(TTR("Invalid RID"));
	}
}
EditorPropertyRID::EditorPropertyRID() {