Global obstructions for being a quotient of a rank $d$ vector bundle 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.
 A: Let me explain a simple example. 
Let $C \subset \mathbb{P}^3$ be a twisted cubic curve. It is a locally complete intersection of codimension 2, hence its ideal $I_C$ is locally generated by two sections. Let me show that there are no surjections $E \twoheadrightarrow I_C$ from a locally free sheaf $E$ of rank 2.
Indeed, assume such a surjection exists. Its kernel is a reflexive sheaf of rank 1, hence is a line bundle, so we have an exact sequence
$$
0 \to L \to E \to I_C \to 0.
$$
Restricting to $C$ we obtain an exact sequence
$$
0 \to \det N^* \to L\vert_C \to E\vert_C \to N^* \to 0,
$$
where $N^*$ is the conormal bundle. But $N^*$ is locally free of rank 2, hence the surjection $E\vert_C \to N^*$ is an isomorphism, hence the middle arrow is zero, hence
$$
\det N^* \cong L\vert_C.
$$
But the adjunction fromula shows that $\det N^* \cong \mathcal{O}_C(-10)$, and this line bundle does not restrict from $\mathbb{P}^3$ (because 10 is not divisible by 3). This contradiction proves that no surjection from $E$ as above exists.
Of course, the same argument works for many other lci of codimension 2.
