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

type = Animation::TYPE_AUDIO;
		}
	};
	struct TrackCacheAnimation : public TrackCache {
		bool playing = false;
		TrackCacheAnimation() {
			type = Animation::TYPE_ANIMATION;
		}
	};
	HashMap<NodePath, TrackCache *> track_cache;
	HashSet<TrackCache *> playing_caches;
	Vector<Node *> playing_audio_stream_players;
	Ref<AnimationNode> root;
	NodePath advance_expression_base_node = NodePath(String("."));
	AnimationProcessCallback process_callback = ANIMATION_PROCESS_IDLE;
	bool active = false;
	NodePath animation_player;
	int audio_max_polyphony = 32;
	AnimationNode::State state;
	bool cache_valid = false;
	void _node_removed(Node *p_node);
	void _setup_animation_player();
	void _animation_player_changed();
	void _clear_caches();
	void _clear_playing_caches();
	void _clear_audio_streams();
	bool _update_caches(AnimationPlayer *player);
	void _process_graph(double p_delta);
	uint64_t setup_pass = 1;
	uint64_t process_pass = 1;