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

AnimationPlayerEditor::get_singleton()->unpin();
			_update_tree();
		}
	} else if (p_id == BUTTON_GROUP) {
		undo_redo->create_action(TTR("Button Group"));
		if (n->is_class("CanvasItem") || n->is_class("Node3D")) {
			undo_redo->add_do_method(n, "remove_meta", "_edit_group_");
			undo_redo->add_undo_method(n, "set_meta", "_edit_group_", true);
			undo_redo->add_do_method(this, "_update_tree");
			undo_redo->add_undo_method(this, "_update_tree");
			undo_redo->add_do_method(this, "emit_signal", "node_changed");
			undo_redo->add_undo_method(this, "emit_signal", "node_changed");
		}
		undo_redo->commit_action();
	} else if (p_id == BUTTON_WARNING) {
		String config_err = n->get_configuration_warnings_as_string();
		if (config_err.is_empty()) {
			return;
		}
		const PackedInt32Array boundaries = TS->string_get_word_breaks(config_err, "", 80);
		PackedStringArray lines;
		for (int i = 0; i < boundaries.size(); i += 2) {
			const int start = boundaries[i];
			const int end = boundaries[i + 1];
			lines.append(config_err.substr(start, end - start + 1));
		}
		warning->set_text(String("\n").join(lines));
		warning->popup_centered();
	} else if (p_id == BUTTON_SIGNALS) {
		editor_selection->clear();