It failed because, after applying the
trim($content)fix, the markup returned from the server has whitespaces between the messages for which jQuery created text elements. When extracting the message ID from these unexpected text elements, it returned
NaNwhich then got passed to all kinds of functions not expecting it. The fix makes Twig remove all whitespaces before sending the HTML to the browser.
The remaining mystery is why I don't need that fix in my local environment.
Have a look at Posts merging: https://www.phpbb.com/customise/db/exte ... tsmerging/