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

new_item_key = p_new_item;
}
Variant EditorPropertyDictionaryObject::get_new_item_key() {
	return new_item_key;
}
void EditorPropertyDictionaryObject::set_new_item_value(const Variant &p_new_item) {
	new_item_value = p_new_item;
}
Variant EditorPropertyDictionaryObject::get_new_item_value() {
	return new_item_value;
}
EditorPropertyDictionaryObject::EditorPropertyDictionaryObject() {
}
void EditorPropertyArray::initialize_array(Variant &p_array) {
	if (array_type == Variant::ARRAY && subtype != Variant::NIL) {
		Array array;
		StringName subtype_class;
		Ref<Script> subtype_script;
		if (subtype == Variant::OBJECT && !subtype_hint_string.is_empty()) {
			if (ClassDB::class_exists(subtype_hint_string)) {
				subtype_class = subtype_hint_string;
			}
		}
		array.set_typed(subtype, subtype_class, subtype_script);
		p_array = array;
	} else {
		VariantInternal::initialize(&p_array, array_type);
	}
}
void EditorPropertyArray::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {