Consider the linear model $$ Y={\underbrace{X_i}_{K\times 1 }}^\top\beta+U_i $$ and assume
(0) There is no intercept in the model
(1) $E(X_i U_i)=0_K$ [orthogonality]
(2) $E(X_i X_i^\top)$ has rank $K$
(3) We have an i.i.d. sample $\{Y_i, X_i\}_{i=1}^n$
Then, the OLS estimator $$ \hat{\beta}=({\underbrace{X}_{n\times K}}^\top X)^{-1} X^\top \underbrace{Y}_{n\times 1} $$ is consistent.
The sketch of the proof is: by Law of large numbers and continuous mapping theorem, we have $plim_{n\rightarrow \infty} \frac{1}{n}(X^\top X)^{-1}=E(X_i X_i^\top)^{-1}$ and $plim_{n\rightarrow \infty}\frac{1}{n} X^\top \underbrace{(X^\top \beta+U)}_Y =E(X_i X_i^\top)\beta+ E(X_i U_i) $. By combining the two expressions, we have $$ plim_{n\rightarrow \infty} \hat{\beta}=E(X_i X_i^\top)^{-1}E(X_i X_i^\top)\beta + E(X_i X_i^\top)^{-1}\underbrace{E(X_i U_i)}_0= \beta $$
Question:
(a) Observe that if $E( U_i) =0$, then (1) is equivalent to $cov(X_i, U_i)=0$. Hence, orthogonality is equal to zero covariance. However, if $E( U_i) \neq 0$, then $cov(X_i, U_i) $ may be different from zero. Hence, orthogonality is not equal to zero covariance in this second setting. Still, the consistency proof goes through. Hence, orthogonality is sufficient for consistency and does not require $E( U_i) =0$. Is this correct?
(b) Let's think about the reverse: is orthogonality necessary for consistency? That is, suppose $E(X_i U_i)\neq 0$ but $cov(X_i, U_i)=0$ because $E(U_i)=0$. Is $\hat{\beta}$ inconsistent? Can you show it in the multidimensional case ($K>1)$?
Note: I have read several questions on orthogonality versus zero covariance (for example, here), but they have not cleared my doubt as they look to generic.
Matlab simulation which shows consistency with no intercept, $E(U_i)\neq 0$, $E(X_i)\neq 0$, $cov(X_i, U_i)\neq 0$, $E(X_i U_i)=0$.
clear rng default J=10^4; beta_OLS_temp=zeros(J,1); r=10^7; beta=2.5; k=-4/5; h=2; for j=1:J X=unifrnd(-1,2,r,1); U=k*(X.^2)+h; Y=X*beta+U; beta_OLS_temp(j,:)=(X.'*X)^(-1)*(X.'*Y); end beta_OLS=sum(beta_OLS_temp(:,1))/J;