In general relativity, suppose as usual that we have the following action for the matter fields
\begin{equation} S_{\mathrm{matter}} = \int_M d^4 x \sqrt{-g} L_{\mathrm{matter}} , \end{equation}
where $L_{\mathrm{matter}}$ is the matter Lagrangian. Then, again as usual, we define the energy-momentum tensor of the matter fields as
\begin{equation} T^{ab} = \frac{2}{\sqrt{-g}} \frac{\delta S_{\mathrm{matter}}}{\delta g_{ab}} \end{equation}
My question is the following: Are there any (physically interesting) cases where we have different $S_{\mathrm{matter}}$, but the same corresponding stress-energy tensor?
It seems like an obvious approach here is to take e.g. the action for the scalar field
\begin{equation} S\left[ \Phi \right] = \int_M d^4 x \sqrt{-g} \left( - \frac{1}{2} g^{ab} \nabla_a \Phi \nabla_b \Phi - V\left( \Phi \right) \right) \end{equation}
and attempt to add to this a piece $S'\left[ \Phi \right]$ such that $\frac{\delta S'}{\delta g_{ab}} =0$. However, I'm struggling to find any plausible such $S'\left[ \Phi \right]$.
So: Do (interesting) cases with different $S_{\mathrm{matter}}$ but the same $T^{ab}$ actually exist? And if so, can people help me find an example? Thanks!