The Hamiltonian is given by $$ H = H_0 + \lambda H_1 $$ where $H_0$ is the unperturbed Hamiltonian, which solves the Schrödinger Equation $$ H_0 \left |n^{(0)} \right \rangle = E_n^{(0)} \left |n^{(0)} \right\rangle $$ If $\lambda$ is sufficiently small, we can make a power series ansatz: $$ E_n = E_n^{(0)} + \lambda E_n^{(1)} + \lambda^2 E_n^{(2)} + \mathcal{O}(\lambda^3) $$ $$|n\rangle = \left |n^{(0)} \right \rangle + \lambda \left |n^{(1)} \right \rangle + \lambda^2 \left |n^{(2)} \right \rangle + \mathcal{O}(\lambda^3) $$
The unperturbed state $\left|n^{(0)}\right\rangle$ is normalized. The $\left|n\right\rangle$ is in general not normalized. To ensure normalization in second order in $\lambda$, we must have $$ \begin{align*} \left\langle n \middle| n \right\rangle &= \left( \left\langle n^{(0)} \right| + \lambda \left\langle n^{(1)} \right| + \lambda^2 \left\langle n^{(2)} \right| \right) \left( \left| n^{(0)} \right\rangle + \lambda \left|n^{(1)} \right\rangle + \lambda^2 \left| n^{(2)} \right\rangle \right) \\ &= \underbrace{\left\langle n^{(0)} \middle| n^{(0)} \right\rangle}_{=1} + \lambda \underbrace{\left[ \left\langle n^{(1)} \middle| n^{(0)} \right\rangle + \left\langle n^{(0)} \middle| n^{(1)} \right\rangle \right]}_{=0} + \lambda^2 \underbrace{\left[ \left\langle n^{(1)} \middle| n^{(1)} \right\rangle + \left\langle n^{(2)} \middle| n^{(0)} \right\rangle + \left\langle n^{(0)} \middle| n^{(2)} \right\rangle \right]}_{=0} \\ \end{align*}$$ (Is this correct?)
The energy expectation value is given by $$ \begin{align*} \left\langle n \middle| \hat{H}_0 + \lambda \hat{H}_1 \middle| n \right\rangle &= \left( \left\langle n^{(0)} \right| + \lambda \left\langle n^{(1)} \right| + \lambda^2 \left\langle n^{(2)} \right| \right) \left({H}_0 + \lambda {H}_1 \right) \left( \left| n^{(0)} \right\rangle + \lambda \left|n^{(1)} \right\rangle + \lambda^2 \left| n^{(2)} \right\rangle \right) \\ &= \left\langle{n^{(0)}}\middle|{\hat{H}_0}\middle|{n^{(0)}}\right\rangle + \lambda \left(\left\langle{n^{(0)}}\middle|{\hat{H}_0}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(1)}}\middle|{\hat{H}_0}\middle|{n^{(0)}}\right\rangle + \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle\right) \\ & \quad + \lambda^2 \left(\left\langle{n^{(1)}}\middle|{\hat{H}_0}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(2)}}\middle|{\hat{H}_0}\middle|{n^{(0)}}\right\rangle + \left\langle{n^{(0)}}\middle|{\hat{H}_0}\middle|{n^{(2)}}\right\rangle + \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle \right) \\ \end{align*} $$ With the assumption from above I get $$ \begin{align*} \left\langle n \middle| \hat{H}_0 + \lambda \hat{H}_1 \middle| n \right\rangle&= \left\langle{n^{(0)}}\middle|{\hat{H}_0}\middle|{n^{(0)}}\right\rangle + \lambda \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle + \lambda^2 \left(\left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle \right) \\ &= E_n^{(0)} + \lambda E_n^{(1)} + \lambda^2 \left( \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle \right) \end{align*} $$ The second-order energy is defined by $E_n^{(2)} = \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle $. Since the Hamiltonian is hermitian, the eigenvalues are real. So $$E_n^{(2)} = \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle = \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle$$
This would yield to $$ \begin{align*} \left\langle n \middle| \hat{H}_0 + \lambda \hat{H}_1 \middle| n \right\rangle &= E_n^{(0)} + \lambda E_n^{(1)} + 2 \lambda^2 E_n^{(2)} \end{align*} $$
This is not the same, as we get from the power series ansatz. Is there a mistake in my consideration? Or where does the discrepancy come from?