I am on the emacs built using the latest commit on the emacs-25 branch.

This error started occurring after this commit: http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=7de84646df80b559daec11e59acde3cf5ad5759e

Looks like the not-this-window var was removed from the defun arg list. But it is still used in the last line of display-message-or-buffer function:

  (t
   ;; Buffer
   (goto-char (point-min))
   (display-buffer (current-buffer)
   not-this-window frame)))))))) ; <-------------------


--
Kaushal Modi