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

EditorPropertyRangeHint hint;
	hint.step = p_default_step;
	if (is_int) {
		hint.hide_slider = false; 
	}
	Vector<String> slices = p_hint_text.split(",");
	if (p_hint == PROPERTY_HINT_RANGE) {
		ERR_FAIL_COND_V_MSG(slices.size() < 2, hint,
				vformat("Invalid PROPERTY_HINT_RANGE with hint \"%s\": Missing required min and/or max values.", p_hint_text));
		hint.or_greater = false; 
		hint.or_less = false;
		hint.min = slices[0].to_float();
		hint.max = slices[1].to_float();
		if (slices.size() >= 3 && slices[2].is_valid_float()) {
			
			hint.step = slices[2].to_float();
		}
		hint.hide_slider = false;
		for (int i = 2; i < slices.size(); i++) {
			String slice = slices[i].strip_edges();
			if (slice == "or_greater") {
				hint.or_greater = true;
			} else if (slice == "or_less") {
				hint.or_less = true;