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

for (int i = 0; i < p_terms.size(); i++) {
		String term = p_terms[i];
		// Recognize special filter.
		if (term.contains(":") && !term.get_slicec(':', 0).is_empty()) {
			String parameter = term.get_slicec(':', 0);
			String argument = term.get_slicec(':', 1);
			if (parameter == "type" || parameter == "t") {
				// F
				String type = get_node(p_item->get_metadata(0))->get_class();
				bool term_in_inherited_class = false;
				// E
				while (type != "Node") {
					if (type.to_lower().contains(argument)) {
						term_in_inherited_class = true;
						break;
					}
					type = ClassDB::get_parent_class(type);
				}
				if (!term_in_inherited_class) {
					return false;
				}
			} else if (parameter == "group" || parameter == "g") {
				// F
				Node *node = get_node(p_item->get_metadata(0));
				if (argument.is_empty()) {
					// W
					if (node->get_persistent_group_count() == 0) {
						return false;
					}
				} else {