Well, it certainly looks suspicious. Still what you suggest is not equivalent to the original code.

In the original code if node is neither root nor prev->left then deleteByMerging(prev->right)...