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

GDCLASS(EditorPropertyTextEnum, EditorProperty);
	HBoxContainer *default_layout = nullptr;
	HBoxContainer *edit_custom_layout = nullptr;
	OptionButton *option_button = nullptr;
	Button *edit_button = nullptr;
	LineEdit *custom_value_edit = nullptr;
	Button *accept_button = nullptr;
	Button *cancel_button = nullptr;
	Vector<String> options;
	bool string_name = false;
	bool loose_mode = false;
	void _emit_changed_value(String p_string);
	void _option_selected(int p_which);
	void _edit_custom_value();
	void _custom_value_submitted(String p_value);
	void _custom_value_accepted();
	void _custom_value_canceled();
protected:
	virtual void _set_read_only(bool p_read_only) override;
	static void _bind_methods();
	void _notification(int p_what);
public:
	void setup(const Vector<String> &p_options, bool p_string_name = false, bool p_loose_mode = false);
	virtual void update_property() override;
	EditorPropertyTextEnum();
};
class EditorPropertyPath : public EditorProperty {