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

lock_preview_update = true;
	lne_prefix->clear();
	lne_suffix->clear();
	lne_search->clear();
	lne_replace->clear();
	cbut_substitute->set_pressed(false);
	cbut_regex->set_pressed(false);
	cbut_process->set_pressed(false);
	chk_per_level_counter->set_pressed(true);
	spn_count_start->set_value(1);
	spn_count_step->set_value(1);
	spn_count_padding->set_value(1);
	opt_style->select(0);
	opt_case->select(0);
	lock_preview_update = false;
	_update_preview();
}
bool RenameDialog::_is_main_field(LineEdit *line_edit) {