You are not giving the animated sprite enough time to play the animation. Because in the frame when you say that the animation should play, the object deletes itself and with it the animated sprite.
Try this:
func on body enter (body):
$AnimatedSprite.play("explosion")
yield(get_tree().create_timer(animation_lenght), "timeout")
queue free()
animation_lenght is the length of your animation, which you have to find out yourself.
Sorry if I made mistakes, my English isn´t very good.