As per the documentation for kill-this-buffer, it should only be invoked from the menu and behaves unpredictably when invoked programmatically.