Sorry, should have done that earlier; I just assumed it didn't hold any information of value for this case.
Debugger entered--Lisp error: (error "Invalid client frame")
signal(error ("Invalid client frame"))
error("Invalid client frame")
server-save-buffers-kill-terminal(nil)
save-buffers-kill-terminal()
eval((save-buffers-kill-terminal) nil)
eval-expression((save-buffers-kill-terminal) nil nil 127)
funcall-interactively(eval-expression (save-buffers-kill-terminal) nil nil 127)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)
When I edebugged save-buffers-kill-terminal, I saw that (frame-parameter nil 'client) was evaluating to non-nil as it was returning "Unprintable entity". So it is executing the wrong clause of that if.