Does this mean that the Hamiltonian doesn't describe a true physical quantity like in classical mechanics?
Even in classical mechanics, Hamiltonian for one particle in external field EM is function
$$
H(\mathbf r,\mathbf p) = \frac{(\mathbf p - \frac{q}{c}\mathbf A(\mathbf r, t))^2}{2m} + q\phi(\mathbf r,t)
$$
where $\mathbf A,\phi$ are any of the valid functions that describe the same external EM field.
The form of the Hamiltonian (dependence on the potentials and $\mathbf r,\mathbf p) is unique, but its value is not; it depends on the choice of the above two functions ("choice of gauge").
This non-uniqueness is no big deal, as Hamiltonian function is mostly a theoretical concept that is useful to formulate the laws and derive other laws; it non-uniqueness is not necessary for that use.
In classical physics, the laws and their consequences can be formulated also in a gauge-independent way with EM fields $\mathbf E,\mathbf B$ only. The potentials and the Hamiltonian can be avoided.
The situation with gauge-dependence is similar to the one with kinetic energy having value that depends on the inertial system it is evaluated for. The value is frame-dependent, but it poses no problem for its use.
Yes, you missed the whole point of gauge invariance which clearly has to be a symmetry – the Hamiltonian has to be and is invariant under these transformations. In the case of a global symmetry, a Hamiltonian may afford "not to be symmetric" under it. But once a group of transformations is said to be a gauge symmetry, the failure of $H$ to be invariant would mean that the theory is mathematically inconsistent.
Your calculation of the second derivative of the exponential is also incorrect, the second term should have $(\lambda')^2$, not the factor with double primes. The Hamiltonians of gauge theories are invariant – but the extra terms from the transformation of the gauge fields $A_\mu = (\varphi,\vec A)$ are needed to cancel the terms with $\lambda'$ and $\lambda''$ that you noticed. But they do so. That's why the gauge fields have to exist in gauge invariant theories.
Best Answer
I will try to slightly elaborate on @VladimirKalitvianski answer.
From Maxwell's equations, we can derive that the following combination of gauge transformations on $\mathbf{A}$ and $\Phi$ leave both $\mathbf{B}$ and $\mathbf{E}$ invariant: \begin{align} & \mathbf{A}'=\mathbf{A}-\mathbf{\nabla} \alpha \\& \Phi'=\Phi+\frac{\partial \alpha}{\partial t} \end{align} where $\alpha=\alpha(\mathbf{x},t)$. This means that all the field configurations of $\mathbf{B}$ and $\mathbf{E}$ related by a gauge transformation are physically equivalent. Note that this has nothing to do with the Hamiltonian operator in QM.
Now in QM, we know that a wave function can always be multiplied by a phase factor: $$ \psi'=e^{-iq\alpha}\psi, $$ where $\alpha \neq \alpha(\mathbf{x},t)$, because the probability of finding the particle at a particular position is unaffected by the above transformation, and also the Schrodinger equation and the probability current are unaffected by the above transformation. If we now demand that the above also holds for when $\alpha = \alpha(\mathbf{x},t)$ (i.e. a gauge transformation), then the Schrodinger equation must be made gauge invariant: \begin{equation} i\frac{\partial\psi}{\partial t}=-\frac{1}{2m}(\mathbf{\nabla}-iq\mathbf{A})^2\psi+(V+q\Phi)\psi \end{equation} such that the Schrodinger equation is invariant under the simultaneous gauge transformations: \begin{align} &\mathbf{A}'=\mathbf{A}-\mathbf{\nabla} \alpha \\& \Phi'=\Phi+\frac{\partial \alpha}{\partial t} \\& \psi'=e^{-iq\alpha}\psi \tag{1} \end{align} Note that we can say that we have adjusted the "normal" Hamiltonian by replacing the ordinary (partial) derivatives by: \begin{equation} \begin{array}{cc} \displaystyle \mathbf{\nabla} \rightarrow \mathbf{D}\equiv \mathbf{\nabla} - i q \mathbf{A} \; ,& \displaystyle \frac{\partial}{\partial t} \rightarrow D^0 \equiv\frac{\partial}{\partial t} + iq \end{array} \end{equation} To sum up, by demanding that our theory is invariant under the gauge transformation expressed by equation $(1)$, we are forced to change the Hamiltonian operator as we have done above. However, by doing this, the new Hamiltonian describes a particle interacting with the potentials $\mathbf{A}$ and $\Phi$. If you're not convinced by this argument, I strongly recommend you to read up on the Aharonov–Bohm effect (http://en.wikipedia.org/wiki/Aharonov%E2%80%93Bohm_effect).
Furthermore, note that we require that a gauge transformation does not affect any observables. This means that we must demand that the probability current is also unaffected. You can show (although it is quite tedious) that the current is made gauge invariant by making the replacement: $\displaystyle \mathbf{\nabla} \rightarrow \mathbf{D}$.