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

container = nullptr;
		}
		return;
	}
	object->set_array(array);
	int size = array.call("size");
	int max_page = MAX(0, size - 1) / page_length;
	page_index = MIN(page_index, max_page);
	int offset = page_index * page_length;
	edit->set_text(vformat(TTR("%s (size %s)"), array_type_name, itos(size)));
	bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property());
	if (edit->is_pressed() != unfolded) {
		edit->set_pressed(unfolded);
	}
	if (unfolded) {
		updating = true;
		if (!container) {
			container = memnew(MarginContainer);
			container->set_theme_type_variation("MarginContainer4px");
			add_child(container);
			set_bottom_editor(container);
			VBoxContainer *vbox = memnew(VBoxContainer);
			container->add_child(vbox);
			HBoxContainer *hbox = memnew(HBoxContainer);
			vbox->add_child(hbox);
			Label *size_label = memnew(Label(TTR("Size:")));
			size_label->set_h_size_flags(SIZE_EXPAND_FILL);
			hbox->add_child(size_label);
			size_slider = memnew(EditorSpinSlider);
			size_slider->set_step(1);