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.