Can both Lagrangian and Hamiltonian formalisms lead to different solutions?
I have a simple system described by the Lagrangian \begin{equation} L(\eta,\dot{\eta},\theta,\dot{\theta})=\eta\dot{\theta}+2\theta^2. \end{equation} The equations of motion are obtained from Euler-Lagrange eq.: \begin{eqnarray} 4\theta-\dot{\eta}=0\; \mathrm{and}\; \dot{\theta}=0, \end{eqnarray} yielding the solution $\eta(t)=4\theta_0t+\eta_0$ where $\eta_0$ and $\theta_0$ are constants.
But when I obtain one of the equations of motion from the Hamiltonian (via Legendre transformation), \begin{equation} H=\left(\frac{\partial L}{\partial\dot\eta}\right)\dot\eta+\left(\frac{\partial L}{\partial\dot\theta}\right)\dot\theta - L =-2\theta^2, \end{equation} \begin{equation} \dot\eta=\frac{\partial H}{\partial p_\eta}=0, \end{equation} the situation is surprisingly different from the Lagrangian approach because $\eta$ is now a constant!
Can someone give a proper explanation for this inconsistency? Am I doing something wrong here?