OLS variance estimator in linear regression without strict exogeneity (I don't remember seeing this result stressed enough.)
Consider the "benchmark" linear regression model
$$\mathbf{Y} = \mathbf{X} \beta + \varepsilon.$$
$$E(\varepsilon) = 0,\, E(\varepsilon \varepsilon' \mid \mathbf X) = \sigma^2I.$$
The initial presentation of this model in econometrics, is with the additional assumption of "strict exogeneity", $E(\varepsilon \mid \mathbf X) =0$. But usually, we move on to say that this assumption is too strong and not expected to hold, and we settle for the weaker assumption $E(\mathbf X' \varepsilon) = 0$.  With this assumption, we lose finite-sample unbiasedness of the OLS estimator, but we retain consistency and asymptotic normality.
Now, in order for the weaker model to be usefully discriminated from the model with strict exogeneity, it must be the case that we have (alongside $E(\mathbf X' \varepsilon) = 0$), $E(\varepsilon \mid \mathbf X) =h(\mathbf X)$ also.
Question: in such a setting, what does the variance estimator of $\hat \beta_{OLS}$ estimate?
 A: By definition, under any case the finite-sample variance of $\hat \beta$
is
$${\rm V}(\hat \beta \mid \mathbf X) = (\mathbf X'\mathbf X)^{-1}\mathbf X'E\left[\varepsilon \varepsilon' \mid \mathbf X\right]\mathbf X(\mathbf X'\mathbf X)^{-1} $$
$$-  (\mathbf X'\mathbf X)^{-1}\mathbf X'E\left[\varepsilon \mid \mathbf X\right]E\left[\varepsilon' \mid \mathbf X\right]\mathbf X(\mathbf X'\mathbf X)^{-1}.$$
Under the assumptions without strict exogeneity but with orthogonality,
$$E(\varepsilon \mid \mathbf X) = h(\mathbf X),\quad E(\mathbf X' \varepsilon) = 0,\quad E(\varepsilon \varepsilon' \mid \mathbf X) =\sigma^2I, $$
the finite sample variance becomes
$${\rm V}(\hat \beta \mid \mathbf X) = \sigma^2(\mathbf X'\mathbf X)^{-1} -  (\mathbf X'\mathbf X)^{-1}\mathbf X'h\left(\mathbf X\right)h'\left(\mathbf X\right)\mathbf X(\mathbf X'\mathbf X)^{-1},$$
while the (conditional) bias of the estimator is
$${\rm B}(\hat \beta \mid \mathbf X) = E(\hat \beta \mid X) - \beta = (\mathbf X'\mathbf X)^{-1}\mathbf X'h\left(\mathbf X\right).$$
It follows that the Mean Squared Error of $\hat \beta$ is
$${\rm MSE}(\hat \beta \mid \mathbf X) = {\rm V}(\hat \beta \mid \mathbf X) + {\rm B}(\hat \beta \mid \mathbf X){\rm B}'(\hat \beta \mid \mathbf X) = \sigma^2\left(\mathbf X' \mathbf X\right)^{-1}.$$
We see that , when we do not assume strict exogeneity but only orthogonality, the finite sample "variance" estimator (that is automatically computed by software) in reality computes the finite-sample Mean Squared Error (this continues to hold if we assume conditional heteroskedasticity and want to compute "robust" standard errors).
In general when we expect the estimator to be biased, we tend to prefer using MSE as a more appropriate "quality" measure than the Variance alone. But this does not mean that we can use MSE in all cases instead of the Variance without consequences. For example, in significance testing, the value of the $t$-statistic will be deflated (in absolute terms) due to the use of the estimated MSE in its denominator.
