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

for (const KeyValue<int, int> &E : base_scene_node_remap) {
		if (E.value == p_idx) {
			return E.key;
		}
	}
	return -1;
}
Variant SceneState::get_property_value(int p_node, const StringName &p_property, bool &found) const {
	found = false;
	ERR_FAIL_COND_V(p_node < 0, Variant());
	if (p_node < nodes.size()) {
		
		int pc = nodes[p_node].properties.size();
		const StringName *namep = names.ptr();
		const NodeData::Property *p = nodes[p_node].properties.ptr();
		for (int i = 0; i < pc; i++) {
			if (p_property == namep[p[i].name & FLAG_PROP_NAME_MASK]) {
				found = true;
				return variants[p[i].value];
			}
		}
	}
	
	if (base_scene_node_remap.has(p_node)) {
		return get_base_scene_state()->get_property_value(base_scene_node_remap[p_node], p_property, found);
	}
	return Variant();
}
bool SceneState::is_node_in_group(int p_node, const StringName &p_group) const {