### Godot version

v4.1.1-stable_mono_win64

### System information

Windows 11

### Issue description

I removed the node to replace it with another, but when I change the path in the code, the engine crashes for me.

### Steps to reproduce

I did a screen recording as it happens:

https://github.com/godotengine/godot/assets/116289408/b2fd2689-8d82-44e8-8e02-be01674842e1



### Minimal reproduction project

[MixApo.zip](https://github.com/godotengine/godot/files/12208403/MixApo.zip)

if (!code_completion_active) {
		return;
	}
	code_completion_forced = false;
	code_completion_active = false;
	is_code_completion_drag_started = false;
	queue_redraw();
}
void CodeEdit::set_line_length_guidelines(TypedArray<int> p_guideline_columns) {
	line_length_guideline_columns = p_guideline_columns;
	queue_redraw();
}
TypedArray<int> CodeEdit::get_line_length_guidelines() const {
	return line_length_guideline_columns;
}
void CodeEdit::set_symbol_lookup_on_click_enabled(bool p_enabled) {
	symbol_lookup_on_click_enabled = p_enabled;
	set_symbol_lookup_word_as_valid(false);
}
bool CodeEdit::is_symbol_lookup_on_click_enabled() const {
	return symbol_lookup_on_click_enabled;
}
String CodeEdit::get_text_for_symbol_lookup() const {