Signal animation_finished emit when changing spriteframes

Godot Version

3.5.3

Question

I discover a strange behaviour in my program and i don’t know if is a bug of the engine or if I do something wrong.
When I change the spriteframe of my AnimatedSprite, the signal “animation_finished” related to the previous spriteframe is emitted and I don’t want that.
It is emitted only after some time.

At first, I don’t notice the bug, because when I change the spriteframe, I immediatly play an animation and it seems that cancel the signal. But now that I implemented a delay for some sprite, the bug occurs.

Note that there before I change the spriteframe, the animation apply to the AnimatedSprite is already finished a long time ago. And there always some error displaying in the logging saying that there no animation name xxx, because the new spriteframe don’t have the same animation that the old one.

Here how I change the spriteframe of my AnimatedSprite :

sprite[i].set_sprite_frames(load(Global.PATH_ANIMATION_TECHNIQUE + folder_spriteframes + "/" + info_anim_composed.anim_name[i]+ "_spriteframes.tres"))