I think that I might have an answer to my own question. I ran a little experiment:
First I generated a synthetic process of the following form: $$ y_t = 5 + 3 \cos(\omega t) + \epsilon_t $$
with $T$ points and frequency $\omega$. Then I fitted a SARIMAX(p,d,q) with $(p,d,q)=(0,0,0)$, with non-zero constant and exogenous variable $X=\cos(\omega t)$: Let's call this model SARIMAX$_1(\omega, T)$.
On the other hand, I fitted another SARIMAX(p,d,q) to the same data, but now with $(p,d,q)=(0,1,0)$ and without allowing for a constant (again $X=\cos(\omega t)$): This is model SARIMAX$_2(\omega, T)$.
I did the above for several values of $\omega, T$, and this is what I got:
$\omega = 30, T=100$: p-values for SARIMAX$_1(\omega, T)$ are $0$ (both for $X$ and the intercept) and for SARIMAX$_2(\omega, T)$ the p-value of $X$ equals $0.007$
$\omega = 30, T=40$: p-values for SARIMAX$_1(\omega, T)$ are $0$ (both for $X$ and the intercept) and for SARIMAX$_2(\omega, T)$ the p-value of $X$ equals $0.023$
$\omega = 30, T=20$: p-values for SARIMAX$_1(\omega, T)$ are $0$ (both for $X$ and the intercept) and for SARIMAX$_2(\omega, T)$ the p-value of $X$ equals $0.419$
$\omega = 70, T=100$: p-values for SARIMAX$_1(\omega, T)$ are $0$ (both for $X$ and the intercept) and for SARIMAX$_2(\omega, T)$ the p-value of $X$ equals $0.289$
$\omega = 20, T=100$: p-values for SARIMAX$_1(\omega, T)$ are $0$ (both for $X$ and the intercept) and for SARIMAX$_2(\omega, T)$ the p-value of $X$ equals $0.0$
So what seems to be happening in the differenced case is that SARIMAX still finds the expected relation with the cosine but it struggles much more to establish significance as compared to the non-differenced case - the difficulty seems to be related to the number of cycles that the original series completes.
Does this make sense? Do you know why this could be the case?