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

List<Node::GroupInfo> group_info_list;
					node->get_groups(&group_info_list);
					bool term_in_groups = false;
					for (int j = 0; j < group_info_list.size(); j++) {
						if (!group_info_list[j].persistent) {
							continue; // I
						}
						if (String(group_info_list[j].name).to_lower().contains(argument)) {
							term_in_groups = true;
							break;
						}
					}
					if (!term_in_groups) {
						return false;
					}
				}
			} else if (filter_term_warning.is_empty()) {
				filter_term_warning = vformat(TTR("\"%s\" is not a known filter."), parameter);
				continue;
			}
		} else {
			// D
			if (!p_item->get_text(0).to_lower().contains(term)) {
				return false;
			}
		}
	}
	return true;
}
void SceneTreeEditor::_compute_hash(Node *p_node, uint64_t &hash) {