$\newcommand{\tr}{\operatorname{tr}}$ $\newcommand{\M}{\mathcal{M}}$ $\newcommand{\Ric}{\operatorname{Ric}} $ $\newcommand{\div}{\operatorname{div}} $
Let $\M$ be a Riemannian manifold, $\nabla^{T\M}$ is its Levi-Civita connection. Given $X \in \Gamma(T\M)$, we consider $\nabla^{T\M} X$ as a linear map (vector bundle morphism) $T\M \to T\M$.
Is it true that for all $X,Y \in \Gamma(T\M)$ $$\Ric(Y,X)=\tr (\nabla^{T\M}Y) \cdot \tr(\nabla^{T\M}X) -\tr ( \nabla^{T\M}Y \circ \nabla^{T\M}X), \tag{1}$$
where $\Ric$ is the Ricci curvature of $\M$.
Motivation: I somehow derived (in a very cumbersome way) the equality $$\int_{\M} \Ric(Y,X)= \int_{\M} \tr (\nabla^{T\M}Y) \cdot \tr(\nabla^{T\M}X) -\tr ( \nabla^{T\M}Y \circ \nabla^{T\M}X) , \tag{2}$$
(I assume $\M$ is closed and oriented; the integration is w.r.t the Riemannian volume form of $\M$).
Edit:
As observed by levap, equality $(1)$ is false. Here is a proof of equality $(2)$, based on a few lemmas in my answer:
First note that $\tr (\nabla^{T\M}Y)=\div Y,\tr (\nabla^{T\M}X)=\div X$, so equality $(2)$ is nothing but
$$\int_{\M} \Ric(Y,X)= \int_{\M} \div Y\cdot\div X -\tr ( \nabla^{T\M}Y \circ \nabla^{T\M}X) . \tag{3}$$
We now turn to analyse both summands of the RHS, up to divergence terms: (since the integral of a divergence is zero, this does not matter for the integral):
The first observation (by Anthony Carapetis) is that $$ (\mathrm{tr}_{13} \nabla^2 Y)(X) = \mathrm{div}(\nabla_X Y) - \mathrm{tr}(\nabla Y \circ \nabla X). \tag{4}$$
(For a proof, see lemma 2 in my answer).
For the other term, we use the identity $\div(fX)=f\div X+\tr(df \otimes X)$, for $f=\div Y$:
$$\div(\div Y X)=\div Y\div X+\tr\big(d\div Y \otimes X\big). \tag{5}$$ Combining equations $(4),(5)$ we obtain that equality $(3)$ is equivalent to
$$\int_{\M} \Ric(Y,X)= \int_{\M} -\tr\big(d\div Y \otimes X\big) +(\mathrm{tr}_{13} \nabla^2 Y)(X). \tag{6}$$
Now, we use $$ \tr\big(d\div Y \otimes X\big) = (\tr_{23} \nabla^2 Y)(X), \tag{7}$$ (See lemma 3 in my answer)
which implies $(6)$ is equivalent to
$$\int_{\M} \Ric(Y,X)= \int_{\M} (\mathrm{tr}_{13} \nabla^2 Y-\tr_{23} \nabla^2 Y)(X). \tag{8}$$
But, lemma 1 in my answer implies that now the integrands are equal: $$ \Ric(Y,X)= (\mathrm{tr}_{13} \nabla^2 Y-\tr_{23} \nabla^2 Y)(X).$$
To summarize, we showed the original integrands are the same up to divergence terms so their integrals are equal.
The right hand side is not tensorial in $X,Y$ so you definitely don't have a trivial equality. Consider for example the case $M = \mathbb{R}^n$ with the flat metric. The left hand side is zero but the right hand side is
$$ \operatorname{tr}(dX) \operatorname{tr}(dY) - \operatorname{tr}(dX \circ dY) $$
where we identify the vector fields $X,Y$ on $\mathbb{R}^n$ with smooth maps $X,Y \colon \mathbb{R}^n \rightarrow \mathbb{R}^n$ and then the full covariant derivatives $\nabla X, \nabla Y$ are identified with the differentials $dX, dY$. When $n > 1$, the identity
$$ 0 = \operatorname{tr}(dX) \operatorname{tr}(dY) - \operatorname{tr}(dX \circ dY) $$
is false already for linear vector fields $X,Y$.