In freshman textbooks like Halliday, Resnick and Krane, We derive the electric field on the surface of a conductor by taking a Gaussian surface of infinitesimally small length and infinitesimally small cross-sectional area $dA$, with one face inside the conductor, and then applying Gauss' Law: \begin{align}E=\frac{\sigma}{\epsilon_0}\end{align} My question is that if we do not limit the length of the Gaussian surface, and take it to be a long Gaussian Surface, but of same cross-sectional area $dA$, with one face inside the conductor, then, as the electric field would be constant along the cross section, we would get: \begin{align}E=\frac{\sigma}{\epsilon_0}\end{align} for all locations, which is an incorrect result.
The progress I have made so far is deducing that the contribution to the electric flux from the other parts of the surface of the conductor would be zero in the case of infinitesimal length, as they would be perpendicular to the lateral surface of Gaussian Cylinder, and their resultant would both enter and exit the lateral surface; moreover, as the area of the lateral surface is $dAdl$, the area would be of a smaller order than $dA$ anyway, thus making the flux zero. However, this should also be true for the case of a long cylindrical Gaussian surface. This seems to strengthen the argument that leads to the incorrect result.