Answer
The hidden assumption is that the wall’s temperature is the same as that of the gas.
Work Step by Step
This is equivalent to saying that the collisions between the gas molecules and the wall are elastic, energy is neither gained nor lost from the wall.
If the wall temperature differed from that of the gas temperature, the gas would steadily lose or gain energy and the kinetic-molecular model would be invalid.