It turns out that the same tasks can be merged several times. Once they are merged, they should be merged for good, and through an error before proceeding to mark a second, identical merge. This breaks nothing, but is still weird.
See an example here: T4190#80837
Originally reported at https://phabricator.wikimedia.org/T909