### Godot version

4.1.dev (1becfea37c)

### System information

MacOS 13.3 M1 Pro

### Issue description

When renaming with Batch Rename using invalid character `NodePath` will be updated with the invalid new name.

### Steps to reproduce

1.  open MRP
2. batch rename all nodes except the root from `e` to `%`
3. look at the `NodePath` on the root

### Minimal reproduction project

[test1.zip](https://github.com/godotengine/godot/files/11377324/test1.zip)

return line_edit &&
			(line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
}
void RenameDialog::_insert_text(String text) {
	LineEdit *focus_owner = Object::cast_to<LineEdit>(get_viewport()->gui_get_focus_owner());
	if (_is_main_field(focus_owner)) {
		focus_owner->selection_delete();
		focus_owner->insert_text_at_caret(text);
		_update_preview();
	}
}
void RenameDialog::_features_toggled(bool pressed) {
	if (pressed) {
		tabc_features->show();
	} else {
		tabc_features->hide();
	}
	
	Size2i new_size = get_size();
	new_size.y = 0;
	set_size(new_size);
}
#endif