I've read "We can only define the integral of a scalar function. The integral of a vector or tensor field is meaningless in curved spacetime" on many books and lectures on General Relativity (For example on this notes from NYU: https://cosmo.nyu.edu/yacine/teaching/GR_2018/lectures/integration.pdf) and I was wondering if there's a way around it. For example, let's say there is a geodesic $z^\mu(\tau)$ and we are integrating some bitensor $G_{\mu\nu}(z,z')$ to get some quantity $Q(x)$
\begin{equation} Q\left(x\right)=\int_{-\infty}^{\infty}G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]d\tau' \end{equation}
Here we are integrating a scalar function (once the bitensor $G_{\mu\nu}$ gets contracted with $G^{\mu\nu}=g^{\mu\alpha}g^{\nu\beta}G_{\alpha\beta}$). Also, the resulting scalar $Q(x)$ is evaluated at a spacetime point $x^\mu$ which might or might not be on the geodesic $z^\mu(\tau)$. Now, we could also try to derive $Q(x)$
\begin{equation} \frac{\partial}{\partial x^{\rho}}Q\left(x\right)=\\=\frac{\partial}{\partial x^{\rho}}\int_{-\infty}^{\infty}G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]d\tau'\end{equation}
This is also a well-defined object, we are integrating a scalar over the worldline and then deriving. Now, what happens if we take the derivative inside the integral?
\begin{equation} \frac{\partial}{\partial x^{\rho}}Q\left(x\right)=\int_{-\infty}^{\infty}\frac{\partial}{\partial x^{\rho}}\left\{ G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]\right\} d\tau' \end{equation}
Now the right hand side is the integral of a tensor with one free index $\rho$. But we had said that $\frac{\partial }{\partial x^\rho}Q(x)$ is well defined. So is integrating over a tensor also ill-defined in this case? Or could we procede without thinking too much about it?
Note: The bitensor $G_{\mu\nu}$ here is not important, it's just an example to show what my question is. If you like think of it as a Green's function.