Answer
The electric field is not always zero everywhere on the closed surface.
Work Step by Step
If there are any net charges outside the surface that generate electric fields, these fields will enter the closed surface at some points (contributing a negative local electric flux term to the surface) and exit at other points (contributing a positive local electric flux term to the surface) such that the total flux is zero.
The electric field is zero everywhere on an arbitrary surface only if there is no charge anywhere, so that the electric field is zero everywhere in space.