The possibility of using align
inside gather
is explicitly mentioned in the official guide to amsmath
.
However it appears there is a bug with \label
; the errors seem innocuous, in the sense that the labels are absorbed correctly notwithstanding, so I guess it should be possible to fix the issue.
In the meantime, you can trick amsmath
into centering the line with a low level hack:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\multispan{2}\hfill$\displaystyle
\sum_{i=1}^n i + \text{expression} = \dfrac{n(n-1)}{2}
$\hfill \label{l1}\\
a+\text{expression}&=b \label{l2} \\
c&=d+\text{expression} \label{l3} \\
e+\text{long expression}&=f-\text{expression}
\end{align}
\eqref{l1} and \eqref{l2} and \eqref{l3}
\end{document}
which will work for the present display, but is not guaranteed to work generally.
Update August 2019
It turns out that the issue is essentially cosmetic:
\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\endalign}{\restorealignstate@}{\global\let\df@label\@empty\restorealignstate@}{}{}
\makeatother
\begin{document}
\begin{gather}
\sum_{i=1}^n i + \text{expression} = \frac{n(n-1)}{2} \label{l1}\\
\begin{align}
a+\text{expression}&=b \label{l2} \\
c&=d+\text{expression} \\
e+\text{long expression}&=f-\text{expression}
\end{align}
\end{gather}
\eqref{l1} and \eqref{l2}
\end{document}
align
insidegather
is explicitly mentioned in the official guide toamsmath
(revision 2016-11-14 and, I'm pretty sure, also in the next revision).