Interesting, I've never noticed this.
How exactly do you call for the layout transition? If it's also within js, it should be easy to do by removing the event listener before transitioning. Or worst case, briefly muting all audio.
But it is a little bit odd that the object destroyed triggers when the layout changes, although it also makes sense in a way.