In 'Fundamental Algebraic Geometry' by Fantechi there is a lemma in section 5.3.2, page 119:

*LEMMA 5.5* Let $S$ be a noetherian scheme and let $F$ be a coherent sheaf on $\mathbb{P}^n_S$. Suppose there exist some integer $N$ such that for all $r \ge N$ the direct image $\pi_*F(r)= \pi_*(F \otimes O_{\mathbb{P}^n_S}(r))$ is locally free. ($\pi$ is the structure morphism $\mathbb{P}^n_S \to S$).
Claim: Then $F$ is flat over $S$.

Now the author leaves as exercise to show that the *converse*(!) of the above lemma holds as well: if $F$ is flat over $S$ then $\pi_*F(r)$ is locally free for all sufficiently large $r$.

Does anybody know how the proof of the converse works or where I can find it?

About the choice of suitable $N$ I conjecture that Serre's vanishing theorem may play an important role in the proof:

Let $A$ a ring and $F$ coherent on $\mathbb{P}^n_A$. Then for all $i \ge 1$ there exist $m_0$ with $H^i(\mathbb{P}^n_A, F(m))$ for all $m \ge m_0$.

But that's just my suspucion, not more since I otherwise not know how a candidate for $N$ can be found.