Implicitly, @mpiktas has assumed that there is no cointegration among his two random walks, as they are not of reduced rank. Borrwing his statements
\begin{align}
\frac{1}{T^2}\sum_{t=1}^TX_t^2=\sum_{t=1}^T\frac{1}{T}\left(\frac{1}{\sqrt{T}}\sum_{s=1}^tU_t\right)^2\to \int_0^1M_{1s}^2ds,
\end{align}
\begin{align}
\frac{1}{T^2}\sum_{t=1}^TY_t^2\to \int_0^1M_{2s}^2ds
\end{align}
and
\begin{align}
\frac{1}{T^2}\sum_{t=1}^TX_tY_t\to \int_0^1M_{1s}M_{2s}ds
\end{align}
as well as
\begin{align}
\hat{\rho}\to \frac{\int_0^1M_{1s}M_{2s}ds}{\sqrt{\int_0^1M_{1s}^2ds\int_0^1M_{2s}^2ds}}
\end{align}
in distribution as $T\to \infty$, we obtain from your relationship between correlation and the OLSE that
\begin{align}
\hat\beta&\to\frac{\int_0^1M_{1s}M_{2s}ds}{\sqrt{\int_0^1M_{1s}^2ds\int_0^1M_{2s}^2ds}}\frac{\sqrt{\int_0^1M_{2s}^2ds}}{\sqrt{\int_0^1M_{1s}^2ds}}\\&=\frac{\int_0^1M_{1s}M_{2s}ds}{\int_0^1M_{1s}^2ds}
\end{align}
This is (for the special case of no constant in the regression and unit error variances assumed here) precisely the spurios regression distribution of the OLS estimator when regressing two independent random walks onto each other derived by Phillips (Journal of Econometrics 1986, Theorem 1a).
You would get a fundamentally different result of course if the two random walks were cointegrated, in which case, as you point out,
$$
\hat\beta-\beta=\mathcal{O}_p(T^{-1})$$
But this would, as alluded to above, require a reduced-rank assumption in the Vector-error correction representation
$$
\Delta Z_t=\Pi Z_{t-1}+u_t
$$
where $Z_t:=(Y_t,X_t)'$. That is, it would need to be possible to decompose $\Pi=\alpha\beta'$, two vectors, where $\alpha$ gives you the speed of adjustment and $\beta$ the cointegration vector.
In the above example with two independent random walks, we may however write
$$
Z_t=IZ_{t-1}+u_t
$$
and hence
$$
\Delta Z_t=u_t
$$
so that $\Pi$ does not have reduced rank 1. (The above generalizes to $K$ variables of course, where it is needed for cointegration that $0<rank(\Pi)<K$.)