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

_update_preview();
}
void RenameDialog::_update_preview(String new_text) {
	if (lock_preview_update || preview_node == nullptr) {
		return;
	}
	has_errors = false;
	add_error_handler(&eh);
	String new_name = _apply_rename(preview_node, spn_count_start->get_value());
	if (!has_errors) {
		lbl_preview_title->set_text(TTR("Preview:"));
		lbl_preview->set_text(new_name);
		if (new_name == preview_node->get_name()) {
			
			const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("accent_color"), SNAME("Editor"));
			const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("default_color"), SNAME("RichTextLabel"));
			lbl_preview->add_theme_color_override("font_color", accent_color.lerp(text_color, 0.5));
		} else {
			lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("success_color"), SNAME("Editor")));
		}
	}
	remove_error_handler(&eh);
}
String RenameDialog::_apply_rename(const Node *node, int count) {