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

spin[i]->set_label(desc[i]);
		default_layout->add_child(spin[i]);
		add_focusable(spin[i]);
		spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyQuaternion::_value_changed).bind(desc[i]));
		if (horizontal) {
			spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
		}
	}
	warning = memnew(Button);
	warning->set_text(TTR("Temporary Euler may be changed implicitly!"));
	warning->set_clip_text(true);
	warning->connect("pressed", callable_mp(this, &EditorPropertyQuaternion::_warning_pressed));
	warning_dialog = memnew(AcceptDialog);
	add_child(warning_dialog);
	warning_dialog->set_text(TTR("Temporary Euler will not be stored in the object with the original value. Instead, it will be stored as Quaternion with irreversible conversion.\nThis is due to the fact that the result of Euler->Quaternion can be determined uniquely, but the result of Quaternion->Euler can be multi-existent."));
	euler_label = memnew(Label);
	euler_label->set_text("Temporary Euler");
	edit_custom_bc->add_child(warning);
	edit_custom_bc->add_child(edit_custom_layout);
	edit_custom_layout->add_child(euler_label);
	for (int i = 0; i < 3; i++) {
		euler[i] = memnew(EditorSpinSlider);
		euler[i]->set_flat(true);
		euler[i]->set_label(desc[i]);
		edit_custom_layout->add_child(euler[i]);
		add_focusable(euler[i]);
		euler[i]->connect("value_changed", callable_mp(this, &EditorPropertyQuaternion::_custom_value_changed));
		if (horizontal) {
			euler[i]->set_h_size_flags(SIZE_EXPAND_FILL);
		}