As discussed in the comments, the problem is that the enemy is sometimes destroyed before the player even notices the collision.
Two possible solutions:
1) Just don't destroy the enemy when it's hitting the player:
# in enemy.gd: Don't die when colliding with the player character
if (body.name != "Player"): queue_free()
2) Add a wait time in both the enemy and the player script before the queue_free:
# Wait one frame to make sure the collision was detected by all parties
yield(get_tree(), "idle_frame")
queue_free()