Here is my fixed fork: https://playcanvas.com/editor/scene/919880
When listening for events on object whose lifetime is not the same as the listener’s, it has to be removed at some point (in this case, the listener’s entity destroy event).
As it wasn’t removed, it was calling the callback twice the second time round.