What symmetry gives you charge conservation? EDIT: The duplicate question linked above was in fact one of those I was referring to in my opening sentence below. In particular, that question asks quite broadly "what symmetry gives you charge conservation?", and the answers given are

*

*Gauge invariance, with a brief explanation of what that means.

*A link to the Wikipedia page for charge conservation.

*A statement that charge is conserved by definition in the classical theory.

None of these addresses my particular concern, which is the following: I believe I can construct a Lagrangian which has no symmetry, and yet in which charge is conserved. Does this mean that the oft-repeated (and seemingly incompatible) statements that "charge is conserved due to global phase invariance" and "charge is conserved due to local gauge invariance" are not correct? Or is there some deficiency with my Lagrangian? Having pondered this for some time over the last couple of years I'm actually leaning towards the latter. It seems my theory is overconstrained, which is already visible at the classical level and possibly (according to people more expert in QFT than me) gives rise to a quantum theory without the correct degrees of freedom to describe a massless photon. I was hoping this question would lead to a deeper discussion of these matters, matters not provoked by the question linked above.

This is a popular question on this site but I haven't found the answer I'm looking for in other questions. It is often stated that charge conservation in electromagnetism is a consequence of local gauge invariance, or perhaps it is due to some global phase symmetry. Without talking about scalar or spinor fields, the EM Lagrangian that we're familiar with is:
$$ \mathcal{L} = -\frac{1}{4}F^2 - A \cdot J + \mathcal{L}_\mathrm{matter}(J) $$
The equation of motion for $A$ is simply
$$ \partial_\mu F^{\mu \nu} = J^\nu $$
From which it follows that $J$ is a conserved current (by the antisymmetry of the field strength). But what symmetry gave rise to this? I'm not supposing that my matter has any global symmetry here, that I might be able to gauge. Then so far as I can tell, the Lagrangian given isn't gauge invariant. The first term is, indeed, but the second term only becomes gauge invariant on-shell (since I can do some integrating by parts to move a derivative onto $J$). But this isn't good enough, because when we derive conserved quantities through Noether's theorem, it's important that our symmetry is a symmetry of the Lagrangian for any field configuration. If it's only a symmetry for on-shell configurations, then the variation of the action vanishes trivially and we can't make any claims about conserved quantities.
For concreteness, suppose that
$$ \mathcal{L}_\mathrm{matter}(J)  = \frac{1}{2} (\partial_\mu \phi) (\partial^\mu \phi) \qquad J^\mu \equiv \partial^\mu \phi $$
Then we find that $\phi$ (a real scalar) satisfies some wave equation, sourced by $A$. The equations of motion here constrain the form of $J$, but off-shell $J$ is just some arbitrary function, since $\phi$ is just some arbitrary function. Then it is clear that the Lagrangian is not gauge-invariant off-shell.
So here's my question: what symmetry does the above Lagrangian have that implies the conservation of the quantity $J$, provided $A$ satisfies its equation of motion? Thank you.

Addendum. It was pointed out by Prahar Mitra that, despite my best efforts to arrange otherwise, my Lagrangian does have a continuous global symmetry, corresponding to shifting $\phi$ by a constant. I can patch this up by adding a term $m^2 \phi^2/2$ to my matter Lagrangian, which doesn't modify the above argument, but kills the symmetry in question.
Interestingly, when I do this, my theory becomes in some sense trivial --- the equations of motion for $A$ will force $\partial^2 \phi = 0$, but the equation of motion for $\phi$ (at least with no electromagnetic field present) is $(\partial^2+m^2)\phi = 0$. Taken together the only solution here is $\phi = 0$. This leads me to contend something new: even though charge conservation can indeed be achieved without our theory having any particular symmetry, if it is not enforced by some symmetry of the matter (and thence only conserved as a result of the equations of motion for $A$, not $\phi$), then the theory will be overconstrained in some way. Can we establish this idea more concretely? How would it translate into the quantum theory?
 A: You should probably read up on the Stueckelberg action and the Affine Higgs mechanism it sends you to. Your boldface supposition "I'm not supposing that my matter has any global symmetry here, that I might be able to gauge" is unwarranted for the specific model you propose, $J_\mu=\partial_\mu\phi$. 
There is a global symmetry, $\phi \to \phi+\alpha$, whose Noether current is, of course, the above. 
You then almost gauged it, by giving it a charge 1, $A_\mu \to A_\mu+\partial_\mu\alpha (x)$, and  $\phi \to \phi+m\alpha(x)$, where I'm adding the requisite dimensionful charge m so α is dimensionless, and the coupling term is $-mA_\mu\partial^\mu \phi$. This is almost gauge invariant, but not quite: there is a "seagull" term missing, as the variation of this coupling term has a net remainder $-m^2 A_\mu \partial^\mu \alpha$. (Stueckelberg, got rid of it by adding a mass term for the photon, 
$\frac{m^2}{2} ~~A_\mu A^\mu$ with the appropriate dimensionful double charge, $m^2$.)
A: In a relativistic field theory, a conserved quantity according to Noether's theorem is given by a conserved current (density) $J^\mu$, i.e. $\partial_\mu J^\mu=0$. Hence, the contradiction you suggest does not really exist. The symmetry corresponding to conservation of electric charge is indeed the global part of the $U(1)$ gauge symmetry.
A: You're right that that Lagrangian isn't in general gauge invariant.  In addition to making the $A^\mu$ terms gauge invariant, the $\mathcal{L}(J)$ term must also be gauge-invariant.  And not just the equations of motion for $J_\mu$, either - the specific algebraic expression for $J_\mu$ in terms of fundamental fields must be such that if you literally plug in the gauge transformation $\lambda(x)$ and simplify, all the terms involving $\lambda(x)$ must cancel out through pure algebra.  For example, in QED $J_\mu$ isn't a single fundamental field, it's a composite field composed of the spinors $\Psi$: specifically, $J_\mu = e \bar{\Psi} \gamma_\mu \Psi$, and the $\Psi$'s also transform nontrivially under the gauge transformation, in such a way that $\partial_\mu J^\mu$ is a simple algebraic identity.
