Is the kernel of a surjective morphism $\mathscr{F} \to \mathscr{G}$ of locally free sheaves locally free?
Solution 1:
Your argument before "seems fine" is actually fine. Your mistake is assuming that a locally free sheaf on an affine scheme must be free - the real result is that a locally free sheaf on an affine scheme corresponds to a projective module, and not all projective modules are free. For instance, $(2,1+\sqrt{-5})$ is a projective module of rank 1 over $\Bbb Z[\sqrt{-5}]$ which is not free.