Definitions
Let $\xi(t)$ be Gaussian white noise, defined by: $$\begin{gathered}\langle\xi(t)\rangle=0,\\ \langle\xi(t_1)\xi(t_2)\rangle=\delta(t_1-t_2).\end{gathered}$$ Now let $X(t)$ be an object undergoing Brownian motion: $$X'(t)=\xi(t).$$
PSD from squaring the Fourier transform
Suppose I want to compute the power spectrum of $X$. Naively, I could just Fourier transform both sides, using the fact that $\xi(t)$ has flat spectrum: $$\begin{aligned}i\omega X(\omega) &= 1, \\ X(\omega)&=\frac{1}{i\omega}.\end{aligned}$$ Taking the absolute square of this then gives the spectral dependence: $$|X(\omega)|^2=\frac{1}{\omega^2}.$$
PSD from formal definition
Now let's try and compute this formally. The power spectral density is defined as $$S_X(\omega)=\lim_{T\rightarrow\infty}\frac{1}{T}\int_0^T\int_0^T\mathrm{d}t_1\mathrm{d}t_2e^{-i\omega(t_1-t_2)}\langle X(t_1)X(t_2)\rangle.$$ Apart from the factor of $1/T$ at the front, this is the expectation value of the absolute square of the Fourier transform. Let's take the PSDs of both sides of the equation $X'(t)=\xi(t)$. The autocorrelation implies that the right-hand side will be $1$. For the left-hand side I have $$\lim_{T\rightarrow\infty}\frac{1}{T}\int_0^T\int_0^T\mathrm{d}t_1\mathrm{d}t_2e^{-i\omega(t_1-t_2)}\langle X'(t_1)X'(t_2)\rangle.$$ Let's use integration by parts over $t_1$. This gives $$\lim_{T\rightarrow\infty}\frac{1}{T}\left[\left.\int_0^T\mathrm{d}t_1e^{-i\omega(t_1-t_2)}\langle X(t_1)X'(t_2)\rangle\right\rvert_{t_1=0}^{t_1=T}+i\omega\int_0^T\int_0^T\mathrm{d}t_1\mathrm{d}t_2e^{-i\omega(t_1-t_2)}\langle X(t_1)X'(t_2)\rangle\right].$$ However, shouldn't both terms here be zero? The values $X(t_1),X'(t_2)$ should be completely uncorrelated, so the expectation value in both terms is $$\langle X(t_1)X'(T_2)\rangle=0.$$
What's gone wrong with the formal analysis? I'm guessing it has something to do with the product rule, and stochastic calculus.