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

switch (p_what) {
		case NOTIFICATION_THEME_CHANGED:
		case NOTIFICATION_ENTER_TREE: {
			Ref<Texture2D> df = get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons"));
			open_big_text->set_icon(df);
			Ref<Font> font;
			int font_size;
			if (expression) {
				font = get_theme_font(SNAME("expression"), SNAME("EditorFonts"));
				font_size = get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts"));
				text->add_theme_font_override("font", font);
				text->add_theme_font_size_override("font_size", font_size);
				if (big_text) {
					big_text->add_theme_font_override("font", font);
					big_text->add_theme_font_size_override("font_size", font_size);
				}
			} else {
				font = get_theme_font(SNAME("font"), SNAME("TextEdit"));
				font_size = get_theme_font_size(SNAME("font_size"), SNAME("TextEdit"));
			}
			text->set_custom_minimum_size(Vector2(0, font->get_height(font_size) * 6));
		} break;
	}
}
void EditorPropertyMultilineText::_bind_methods() {