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

lne_suffix->set_name("lne_suffix");
	lne_suffix->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	grd_main->add_child(lbl_prefix);
	grd_main->add_child(lbl_suffix);
	grd_main->add_child(lne_prefix);
	grd_main->add_child(lne_suffix);
	
	cbut_regex = memnew(CheckButton);
	cbut_regex->set_text(TTR("Use Regular Expressions"));
	vbc->add_child(cbut_regex);
	CheckButton *cbut_collapse_features = memnew(CheckButton);
	cbut_collapse_features->set_text(TTR("Advanced Options"));
	vbc->add_child(cbut_collapse_features);
	tabc_features = memnew(TabContainer);
	tabc_features->set_use_hidden_tabs_for_min_size(true);
	vbc->add_child(tabc_features);
	
	VBoxContainer *vbc_substitute = memnew(VBoxContainer);
	vbc_substitute->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	vbc_substitute->set_name(TTR("Substitute"));
	tabc_features->add_child(vbc_substitute);
	cbut_substitute = memnew(CheckBox);
	cbut_substitute->set_text(TTR("Substitute"));
	vbc_substitute->add_child(cbut_substitute);
	GridContainer *grd_substitute = memnew(GridContainer);
	grd_substitute->set_columns(3);
	vbc_substitute->add_child(grd_substitute);
	
	but_insert_name = memnew(Button);
	but_insert_name->set_text("NAME");