For simplicity, I'll consider perhaps the simplest possible example of a gauge theory.
Consider a spontaneously broken ${\rm U(1)}$ gauge theory of a charged scalar field coupled to the electromagnetic field $$\mathscr{L}=(D_\mu\phi)^*(D^\mu\phi)-\mu^2\phi^*\phi-\lambda(\phi^*\phi)^2-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}\tag{1}$$ with $\lambda>0$ and $\mu^2<0$. When the field $\phi$ with the polar parametrization $$\phi(x)=\frac{1}{\sqrt{2}}\big(v+h(x)\big)\exp{[i\zeta(x)/v]}\tag{2}$$ plugged into Eq.$(1)$, the field $\zeta$ disappeaears from the theory upon making a suitable gauge transformation. Therefore, there is no Goldstone mode.
Question What causes the Goldstone theorem not to be applicable here? I mean, is there a crucial assumption used in the derivation of Goldstone theorem fails here?