This code seems to not work, I tried and it doesn’t for me. I found a bug which is corrected since 2018 in github, but it’s not corrected correctly I think.
The best option would be to create a function that emits a signal, I will try it.
You can also write a function in the script of the AnimationPlayer that will emit a signal, and call it in the animation by adding a function call keyframe. Or just call the function of the receiver node directly.