The issue is that tex generates an error like the following:
LaTeX Error: \begin{theorem} on input line 5 ended by \end{proposition}.
On the other hand, the relevant regular expression in LaTeX-error-description-list doesn't allow for "on input line X". This patch generalizes that regular expression so that it matches such output.
Thanks, best,
Paul