### 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(EditorPropertyNodePath, EditorProperty);
	Button *assign = nullptr;
	Button *clear = nullptr;
	SceneTreeDialog *scene_tree = nullptr;
	NodePath base_hint;
	bool use_path_from_scene_root = false;
	bool pointer_mode = false;
	Vector<StringName> valid_types;
	void _node_selected(const NodePath &p_path);
	void _node_assign();
	void _node_clear();
	bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
	void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
	bool is_drop_valid(const Dictionary &p_drag_data) const;
	String _get_meta_pointer_property() const;
	virtual Variant _get_cache_value(const StringName &p_prop, bool &r_valid) const override;
	virtual StringName _get_revert_property() const override;
protected:
	virtual void _set_read_only(bool p_read_only) override;
	static void _bind_methods();
	void _notification(int p_what);
public:
	virtual void update_property() override;
	void setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types, bool p_use_path_from_scene_root = true, bool p_pointer_mode = false);
	EditorPropertyNodePath();
};
class EditorPropertyRID : public EditorProperty {