Thanks, your explanation makes sense.

Now with all the substitution rules I have ended up with a term like

\begin{equation}{}Ricci = -6\partial_{0}{}^{0}{a} {a}^{-3}-16\partial_{0}{a} \partial^{0}{a} {a}^{-4}+16\delta_{0}{}^{0} \partial_{0}{a} \partial^{0}{a} {a}^{-4}\end{equation}

Notice the $\delta_{0}{}^{0}$.

I can't figure out how to substitute this away, it gets turned into one right away in the substitution rule and therefore the pattern can't match.