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

if (!big_text_dialog) {
		big_text = memnew(TextEdit);
		if (expression) {
			big_text->set_syntax_highlighter(text->get_syntax_highlighter());
			big_text->add_theme_font_override("font", get_theme_font(SNAME("expression"), SNAME("EditorFonts")));
			big_text->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("expression_size"), SNAME("EditorFonts")));
		}
		big_text->connect("text_changed", callable_mp(this, &EditorPropertyMultilineText::_big_text_changed));
		big_text->set_line_wrapping_mode(TextEdit::LineWrappingMode::LINE_WRAPPING_BOUNDARY);
		big_text_dialog = memnew(AcceptDialog);
		big_text_dialog->add_child(big_text);
		big_text_dialog->set_title(TTR("Edit Text:"));
		add_child(big_text_dialog);
	}
	big_text_dialog->popup_centered_clamped(Size2(1000, 900) * EDSCALE, 0.8);
	big_text->set_text(text->get_text());
	big_text->grab_focus();
}
void EditorPropertyMultilineText::update_property() {
	String t = get_edited_property_value();
	if (text->get_text() != t) {
		text->set_text(t);
		if (big_text && big_text->is_visible_in_tree()) {
			big_text->set_text(t);
		}
	}
}
void EditorPropertyMultilineText::_notification(int p_what) {