You have a messages in a thread display.

You are at the top message in a thread, you delete it, it disappears
(goes to Trash folder) and next message becomes tops and gets displayed
in the lower pane.

You press Control Z (undo) and the deleted message comes back in the
current folder and is displayed in upper header pane, mostly likely with
a + appearing in front the current thread.

but, the lower pane continues displaying the second message that was
being displayed before you pressed the ^Z.

So, we have a situation in which our point in upper header pane is on a
different message and the bottom content pane is displaying the content
of a different message. Any keyboard or mouseclick actions will work on
the restored message on which cursor is there in the upper pane while
you think it is the next message because it is displayed so in the
bottom pane.

It should not happen like this. A bug.