So here is a MWE that illustrates the problem.
\documentclass{beamer}
\defbeamertemplate{frametitle}{weird}{%
\insertframetitle\par%
\rule{\textwidth}{4pt}%
\flushright%
\insertframesubtitle\par%
}
\setbeamertemplate{frametitle}[weird]
\begin{document}
\begin{frame}
\frametitle{Here is the title}
%\framesubtitle{Here is the subtitle}
Here is the text
\pause
Here is more text
\end{frame}
\end{document}
This code fails with a:
! LaTeX Error: Something's wrong--perhaps a missing \item.
Commenting out the \pause or \flushright or uncommenting the \framesubtitle allows it to compile. [Commenting out the \pause leads to a spurious empty page at the end.]
So my guess is that this is a "wrong mode" problem when the subtitle is empty. But I don't know enough to fix it. Any clues? Or any hints on what to try in order to fix it?