### Godot version

v4.0.beta.custom_build [cc7aa72f0], v3.5.1.stable.official [6fed1ffa3]

### System information

Windows 10

### Issue description

`AnimationTree.rename_parameter` doesn't work when called from gdscript. It should rename AnimationTree's nodes. I have confirmed from the source how to call this and what parameters the editor uses when renaming nodes from the editor. For some reason, even when using the same parameters in gdscript, nothing happens.

I'm not sure if is this regression (if it is, it's quite old) or has it ever been tested to work. Seems a bit obscure method to be exposed anyway, unless somebody wants to make a custom editor plugin for AnimationTree. I ran into the issue trying to add class reference description for it.

### Steps to reproduce

* Add AnimationTree with any parameter named `CurrentName`
* Call following code:
```
rename_parameter("parameters/CurrentName", "parameters/NewName")
```


### Minimal reproduction project

[Rename Parameter bug.zip](https://github.com/godotengine/godot/files/10513522/Rename.Parameter.bug.zip)

case Animation::TYPE_SCALE_3D: {
						track_xform->scale_used = true;
					} break;
					default: {
					}
				}
			} else if (track_cache_type == Animation::TYPE_VALUE) {
				// 
				TrackCacheValue *track_value = static_cast<TrackCacheValue *>(track);
				bool was_discrete = track_value->is_discrete;
				bool was_using_angle = track_value->is_using_angle;
				track_value->is_discrete |= anim->value_track_get_update_mode(i) == Animation::UPDATE_DISCRETE;
				track_value->is_using_angle |= anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_LINEAR_ANGLE || anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_CUBIC_ANGLE;
				if (was_discrete != track_value->is_discrete) {
					ERR_PRINT_ED("Value track: " + String(path) + " with different update modes are blended. Blending prioritizes Discrete mode, so other update mode tracks will not be blended.");
				}
				if (was_using_angle != track_value->is_using_angle) {
					WARN_PRINT_ED("Value track: " + String(path) + " with different interpolation types for rotation are blended. Blending prioritizes angle interpolation, so the blending result uses the shortest path referenced to the initial (RESET animation) value.");
				}
			}
			track->_pass = _pass;
		}
	}
	List<NodePath> to_delete;
	for (const KeyValue<NodePath, TrackCache *> &K : track_cache) {
		TrackCache *tc = track_cache[K.key];
		if (tc->_pass != _pass) {
			to_delete.push_back(K.key);
		}
	}