I've been reading up on how the linearised Einstein field equations can be derived from a field theoretic perspective, by constructing the most general Lagrangian for a massless spin-2 field, $h_{\mu\nu}$, compatible with locality and Lorentz invariance. This is given by $$\mathcal{L}=a\partial_{\lambda}h^{\mu\nu}\partial^{\lambda}h_{\mu\nu}+b \partial_{\mu}h^{\mu\lambda}\partial^{\nu}h_{\lambda\nu}+c\partial_{\mu}h\partial_{\nu}h^{\mu\nu}+d\partial_{\mu}h\partial^{\mu}h$$ Now, the requirement of Lorentz invariance requires that $\mathcal{L}$ is invariant under the transformation $$h_{\mu\nu}\rightarrow h_{\mu\nu}+2\partial_{(\mu}\xi_{\nu)}$$ where $\xi^{\mu}$ is a generic 4-vector. This transformation corresponds exactly to a gauge transformation of the spin-2 field.
In principle, one should be able to determine the forms of the coefficients $a$, $b$ $c$ and $d$. However, it seems impossible to do so without relaxing the condition of strict Lorentz invariance of $\mathcal{L}$ to requiring that it is invariant up to a boundary term. What does this mean for the gauge invariance of the theory? If it is to correspond to GR then the theory should be invariant under these linearised diffeomorphisms, right?
What am I missing? If someone could enlighten me on this it would be much appreciated.