In this recent question (which now has an answer), Richard Thomas asked whether any projective $k$-scheme $X$ of (local) embedding dimension $d(X)$ can be embedded in a smooth $k$-scheme of dimension $d(X)$. If $i \colon X \hookrightarrow Y$ is such an embedding, then in particular we get a surjection $i^*\Omega_Y \twoheadrightarrow \Omega_X$. My (so far unsuccessful) strategy was to obstruct such a surjection from existing.

For a coherent sheaf $\mathscr F$, write $d_x(\mathscr F) = \dim_{\kappa(x)} \mathscr F_x \otimes_{\mathcal O_{X,x}} \kappa(x)$ and $$d(\mathscr F) = \max \left\{d_x(\mathscr F)\ |\ x \in X\right\}.$$

Question.If $X$ is a quasi-projective $k$-scheme, and $\mathscr F$ a coherent sheaf, does there exist a surjection $\mathscr E \twoheadrightarrow \mathscr F$ from a locally free sheaf of rank $d(\mathscr F)$?

Already if $X = \mathbf A^n$ this seems false to me; for example there should exist finite modules $M$ with $d(M) = 2$ that cannot be generated by $2$ elements (here I am using the Quillen–Suslin theorem that a finite projective module on $\mathbf A^n$ is free). But I don't know so many ways to prove that something is not generated by $2$ elements, except for a local obstruction $d_x(\mathscr F) > 2$.

I think it should be possible to give a negative answer to Thomas's question along these lines, by exhibiting a finite flat cover $\pi \colon X \to \mathbf A^n$ such that $\pi_*\Omega_X$ does not admit a surjection from a vector bundle of rank $\deg(\pi) \cdot d(\Omega_X)$. A great answer would incorporate something like this, but I would already be very happy with some global obstruction to surjecting from a vector bundle of a given rank.