Your reasoning indeed shows that No, there is no flat connection on $ TS^2 $.
The way you phrased your question brings up an important distinction that needs to be made: It actually doesn't make sense to ask "is this bundle flat?" Instead we must ask, "Is this connection on this bundle flat?" or "Does this bundle admit a flat connection?" That is, "flatness" is a property of a connection on a bundle, not a property of the bundle itself.
The distinction is not just nit-pickiness, it does matter. For example, the tangent bundle to the torus admits a flat connection, but when most of us think of the torus as the surface of a donut sitting in $\mathbb R^3$, we are actually thinking of it as being equipped with a non-flat connection.
For the two-sphere you could, if you wanted, choose some appropriate neighborhood of a point and find a connection with no curvature in this neighborhood. Intuitively this is like taking the L.C. connection on a sphere where we've flattened part of it (a deflated ball resting on a flat surface). But it is impossible to do this everywhere on the sphere:
It turns out that there are some vector bundles where you simply cannot find any connection which is flat everywhere, and I think this is what your original question was probably about. Chern-Weil theory is the precise version of that statement. It says roughly that some vector bundles (like the tangent bundle to $S^2$) have certain topological quantities (like the Euler characteristic of $S^2$) that can be computed from the curvature of a (metric) connection on that bundle. When these topological quantities are nonzero (like $\chi(S^2)=2$) then flat connections are forbidden by the topology of the bundle. I mentioned Chern-Weil theory, but really the Chern-Gauss-Bonnet theorem is sufficient to argue that $TS^2$ does not admit a flat connection.