If you close a tab and than reopen this tab with »Edit > Undo Close Tab« this tab loses its history, so you cant go back and forth after that operation.
With regards to the current shipping version of Safari, "undo close last tab" is a browser feature, not a Webkit feature, and it has never supported restoring the history. Since this bug is about Safari and not the WebKit project, it's invalid as far as WebKit bugs go.