Let me try to give an example of a principal ideal of a ring $R$ that is locally free in the weak sense but not projective.

(I tried briefly, but I couldn't think of an example where $R$ is an integral domain. I suspect there are no such examples: every flat cyclic module over an integral domain is projective, and I think an "invariant factor" argument like the one below shows that it's enough to check on cyclic modules.)

Incidentally, for finitely generated $R$-modules $M$, being locally free in the weaker sense is the same as being flat [Bourbaki AC II.3.4 Pr. 15]. ($R$ doesn't have to be noetherian for this; though some books seem to assume this.)

**Lemma.** If $M$ is a finitely generated, and projective $R$-module, then its invariant factors are finitely generated.

(It looks to me as though the converse also true — i.e., that a finitely generated flat $R$-module is projective iff its invariant factors are finitely generated. Is that right? Is it well-known?)

**Corollary.** A flat ideal $I$ of $R$ is projective only if (and, I think, if) its annihilator is finitely generated.

**Example.** Let $A$ be the direct sum $\bigoplus_{n=1}^{\infty}\mathbf{F}_2$, and let $R=\mathbf{Z}\times A$. Let $x:=(2,0)\in R$, and consider the ideal $I=(x)$.

I first claim that for any prime ideal $\mathfrak{p}\in\mathrm{Spec}(R)$, the $R_{\mathfrak{p}}$-module $I_{\mathfrak{p}}$ is free of rank $0$ or $1$. There are three cases: (1) If $x\notin\mathfrak{p}$, then $I_{\mathfrak{p}}=R_{\mathfrak{p}}$. (2) If $x\in\mathfrak{p}$ and $\mathfrak{p}$ does not contian $A$, then $I_{\mathfrak{p}}=0$. (3) Finally, if both $x\in\mathfrak{p}$ and $A\subset\mathfrak{p}$, then $I_{\mathfrak{p}}$ is a principal ideal of $R_{\mathfrak{p}}$ with trivial annihilator.

It remains to show that $I$ is not projective as an $R$-module. But its annihilator is $A$, which is not finitely generated.