In Classical Electrodynamics (CED) the gauge invariance means independence of the electric and magnetic fields from a particular "choice" of the potentials $\varphi$ and $\bf{A}$. The equation for potentials depend, of course, on the particular choice of the "gauge", and they give different solutions for different gauges.

In QM and QED the gauge invariance means also "invariance" of the form of equations (the solutions being still different, but physically equivalent).

Finally, any helpful variable change is as well acceptable if the corresponding results remain physically the same. For that the form of equations should not obligatory be "invariant" at all.