A diagram to understand the situation:

<verbatim>
    [V]_
     ^  \____
     |   ____[M]   (the merge from P added B)
     | _/     |
    [P]       |
     |        |
[rn A to B ]  |
     |        |
[create A  ]  |
     |        |
     |    __[ . ]
     |   /
[   root   ]
</verbatim>

So, looking at renames between P and M (with merges) does not have any rename in the way. But if we get the shortest path without merges (direct only), through root, there appears a rename "from B to A" (the reverse of the checkin).

This rename makes the merge fail.