We determine the area of the rectangle triangle (which is $\frac{rh}{2}$, $r$ is the radius of circle and $h$ the height). Then we can think that the volume of the cone is the area of the rectangle which runs the interval $[0,2\pi]$. Where is the mistake ? (Maybe it is the question of the "basis" considered)
Thanks in advance !
We can obtain the result following that idea by Pappus's centroid theorem
notably, since for the cone the centroid of the generating triangle is located at $\frac13 r$ from the rotation axis we have
$$V=2\pi\frac13 r\cdot \frac12 rh=\pi r^2\frac h 3$$