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

class SceneTreeEditor : public Control {
	GDCLASS(SceneTreeEditor, Control);
	EditorSelection *editor_selection = nullptr;
	enum SceneTreeEditorButton {
		BUTTON_SUBSCENE = 0,
		BUTTON_VISIBILITY = 1,
		BUTTON_SCRIPT = 2,
		BUTTON_LOCK = 3,
		BUTTON_GROUP = 4,
		BUTTON_WARNING = 5,
		BUTTON_SIGNALS = 6,
		BUTTON_GROUPS = 7,
		BUTTON_PIN = 8,
		BUTTON_UNIQUE = 9,
	};
	Tree *tree = nullptr;
	Node *selected = nullptr;
	ObjectID instance_node;
	String filter;
	String filter_term_warning;
	AcceptDialog *error = nullptr;
	AcceptDialog *warning = nullptr;
	bool auto_expand_selected = true;
	bool connect_to_script_mode = false;
	bool connecting_signal = false;
	int blocked;
	void _compute_hash(Node *p_node, uint64_t &hash);