Am I free to add a contact term to Feynman diagram calculations? In a model with 3 particles $\psi$, $\phi$, and $\gamma$, suppose we have three diagrams and subsequently three amplitudes $\mathcal{M}^\mathrm{s}_\mu$, $\mathcal{M}^\mathrm{t}_\mu$ and $\mathcal{M}^\mathrm{u}_\mu$, where $\mathrm{s}$, $\mathrm{t}$ and $\mathrm{u}$ correspond to the appropriate Mandelstam variable and the index $\mu$ indicates that the photon line was cut off (more precisely we removed the polarisation vector $\epsilon_\mu$ of the $\gamma$). Now the Ward identity states that
$$k^\mu \mathcal{M}^\mathrm{total}_\mu= 0\quad,$$
where $\mathcal{M}^\mathrm{total}$ is the coherent sum of all involved processes. Now suppose that
$$k^\mu \left(\mathcal{M}^\mathrm{s}_\mu + \mathcal{M}^\mathrm{t}_\mu + \mathcal{M}^\mathrm{u}_\mu\right)= \xi$$
where $\xi \neq 0$. This is not a gauge-invariant process. To fix this, I could add a pole-less contact term such that $k^\mu \mathcal{M}^\mathrm{c}_\mu = \xi$.
However, I don't know why I am allowed to do so. Any reasoning would be much appreciated.
Edit:
The reaction is $\psi\gamma\rightarrow\psi\phi$. $\psi$ is a fermion, $\phi$ a scalar boson and $\gamma$ a real photon.
 A: The process under consideration is $\psi A_\mu \rightarrow \psi \phi$, where $A_\mu$ is the photon, $\psi$ is a charged fermion, and $\phi$ is a scalar.
The easiest way to guarantee consistent (perturbative) S-matrix element, is to start from a Lagrangian that is local, Gauge invariant, and real. The simplest Lagrangian that could give rise to this process is a charged fermion with a Yukawa coupling to a scalar
\begin{equation}
\mathcal{L} = -\frac{1}{4} F_{\mu\nu}^2 + i \bar\psi D_\mu \gamma^\mu \psi + g \phi \bar\psi \psi
\end{equation}
This Lagrangian is renormalizable, and would give you two cubic vertices $\sim A \bar\psi \psi$ and $\sim \phi \bar\psi \psi$ that can generate your process. There is no contact interaction needed.
From the comments, it's clear this is not the interaction the OP is interested in. The next simplest option is to couple the scalar to the fermion kinetic term
\begin{equation}
\mathcal{L} = -\frac{1}{4} F_{\mu\nu}^2 + i\left(1 + \frac{g}{M} \phi\right) \bar\psi D_\mu \gamma^\mu \psi 
\end{equation}
where $g$ is a dimensionless coupling and $M$ is a mass scale. Note this interaction is a dimension-5 operator, so the theory is not renormalizable (but this is ok if we think of it as an effective field theory).
This gives you two cubic interactions you need for the $s$, $t$, and $u$ channels $\sim p \phi \bar\psi \psi, A \bar\psi \psi $(where $p$ is the momentum of one of the fermions), and a quartic interaction $\sim \phi A \bar \psi \psi $ which will generate the quartic contact interaction. In order for this term to be gauge invariant, not only can you have the quartic interaction, you must have it (with the right coefficient) for the result to be gauge invariant.
At the level of S-matrix elements, without starting from a Lagrangian, you can try guessing appropriate interactions and look for combinations that will satisfy the Ward identity. This works, and will inevitably produce a result that can be derived from a gauge invariant Lagrangian (the point of effective field theory is that starting from the most general Lagrangian consistent with the symmetries, you can derive the most general unitary S-matrix consistent with all the symmetries). If you proceed in this way, you should proceed with the most general set of vertices/diagrams that you can write down that contribute to your process, that are consistent with symmetries and contribute to the order in energy you are working to. You may then find that consistency conditions like unitarity or the Ward identity force certain choices relating the couplings in the vertices you started with. This is essentially the process the OP followed by realizing the coefficient of the contact interaction needed to be nonzero, and related to the $s$, $t$, and $u$ channels.
