The following may be because of the SQL error
2) the thread that's being merged isn't removed from mybb_threads
3) the original thread (where the all the posts are going to be at the end) doesn't have the replies count or lastpost updated.