Consider a real massive vector field with lagrangian density
$$\begin{align}\mathcal{L}&=-\frac{1}{4}(\partial_\mu A_\nu-\partial_\nu A_\mu)(\partial^\mu A^\nu-\partial^\nu A^\mu)+\frac{1}{2}m^2 A^\mu A_\mu\\&=-\frac{1}{2}(\partial_\mu A_\nu-\partial_\nu A_\mu)\partial^\mu A^\nu+\frac{1}{2}m^2 A^\mu A_\mu.\tag{1}\end{align}$$
Under a local gauge transformation $A_\mu\longrightarrow A_\mu+\partial_\mu f$ the lagrangian density is not invariant
$$\begin{align}\mathcal{L}\longrightarrow&~\mathcal{L}+\frac{1}{2}m^2\left(2A^\mu+\partial^\mu f\right)\partial_\mu f\\=&\,\mathcal{L}-\frac{1}{2}m^2f\left(2\partial_\mu A^\mu+\square f\right)\end{align}\tag{2}$$
unless we take an $f$ that satisfies $$\square f=-2\partial_\mu A^\mu\tag{3}.$$
Equations of motion for the vector field are
$$(\square+m^2) A^\mu-\partial^\mu\partial_\nu A^\nu=0,\tag{4}$$ and taking its divergence $\partial_\mu$ we obtain $$\partial_\mu A^\mu=0\tag{5}.$$
This identity is the Lorenz gauge, but it is satisfied automatically. Then, from $(3),$ $A_\mu\longrightarrow A_\mu+\partial_\mu f$ is a symmetry of the theory as long as $\square f=0$. Can this be considered a kind of "partial" or "reduced" gauge symmetry?
Edit: I realized one thing.
With $(5)$, the eom $(4)$ becomes $$(\square+m^2)A_\mu=0,\tag{6}$$ but this equation is not invariant under the transformation $A_\mu\longrightarrow A_\mu+\partial_\mu f$ even if $\square f=0$. Why is this equation not invariant but the lagrangian density is?