Every finitely generated flat module over a ring with finitely many minimal primes is projective

There are two questions here. First of all, yes, the argument is fine; secondly, yes, there are rings with finitely many minimal primes, but infinitely many associated primes. So all together, the criterion is slightly more general than the one by Raynaud-Gruson mentioned in the question, but the proof is much easier. It also admits a further generalisation (very slightly) as shown below.

First, the construction of a ring with finitely many minimal primes but infinitely many associated primes. It is obviously inspired by the ring $k[t,x]/(t^2,tx)$ which corresponds to the line with an embedded point in the origin, just that we take infinitely many embedded points. Of course, we have to leave world of polynomials for that.

Let $H$ be the ring of holomorphic functions on the complex line $\mathbb{C}$ (with coordinate $z$) and $f\in H$ a non-trivial holomorphic function with infinitely many zeros. Then $A = H[t]/(t^2,tf)$ is such an example. The nilradical of $A$ is the prime ideal $(t)$. Thus, $(t)$ is the unique minimal prime. However, for each root $\alpha\in\mathbb{C}$ of $f$, we easily see that $(t,z-\alpha) = \mathrm{ann}_{A}(t(z-\alpha)^{-1}f)$ is an associated prime of $A$. By assumption, there are infinitely many roots, hence infinitely many associated primes.

To give a complement to the arguments given in the question and the comments on MSE, here is the generalisation to schemes (using the same arguments).

Let $X$ be a scheme with open connected components, each of which is a finite union of maximal irreducible components. Then every flat quasi-coherent $\mathcal{O}_X$-module of pointwise finite rank is Zariski-locally trivial.

This is a local question and we assumed the connected components to be open, so we may just assume that $X$ is connected and show that the rank is constant then. Let $F$ be a quasi-coherent flat $\mathcal{O}_X$-module with $F_x$ finitely generated for each $x\in X$. Let $\eta_1,\eta_2,\dots \eta_s\in X$ be the generic points of the maximal irreducible components $X_i := \{\eta_i\}^{-}$, $i = 1,2,\dots s$. We first have to show that the rank of $F$ is constant on each $X_i$. The basic thing to note is: if $y\leadsto x$ is a specialisation, i.e., $x\in\{y\}^{-}$, then $\mathcal{O}_{X,y}$ is a localisation of $\mathcal{O}_{X,x}$ and with respect to this structure we have $F_{y} = F_{x}\otimes_{\mathcal{O}_{X,x}}\mathcal{O}_{X,y}$. Therefore, if $F_x$ is a free $\mathcal{O}_{X,x}$-module, then $F_y$ is a free $\mathcal{O}_{X,y}$-module of the same rank. By definition, each $x\in X_i$ is a specialisation of $\eta_i$ and so the rank is constant on each maximal irreducible component.

To show that the rank is constant on our connected scheme $X$ we consider the subsets $V_k := \{x\in X\mid \mathrm{rk}_{\mathcal{O}_{X,x}}(F_x) = k\}$ disjointly covering $X$ as $k\geq 0$. Since the rank is constant on maximal irreducible components, each $V_k$ is a union of such. But there are only finitely many maximal irreducible components, so there are only finitely many nonempty $V_k$ and all of them are closed, hence, also open. Since $X$ is connected, the only possibility for this to happen is when $X = V_k$ for some $k\geq 0$, i.e., if the rank is $k$ at every point.


Over a general ring (not necessarily commutative), every finitely presented flat module is projective.

So, one simple condition on the ring that gives you what you want is that every finitely generated module is finitely presented. Of course, these are just the (left) Noetherian rings.