In this chapter on Kinetic Theory of gases, Feynman is trying to find a formula for pressure of a gas in terms of the average kinetic energy of the gas particles. He does so by assuming a piston, which is free to move, and a gas enclosed within some volume. He is using Newtonian laws in his explanations. First, he considers a single particle which is colliding with the piston. Suppose $m$ is the mass of the particle, and $v_x$ is the component of its velocity along the $x-$axis. Also, he assumes that the piston is fixed, and there is no loss of energy to the piston in the form of heat. So, after colliding, the particles velocity becomes $-v_x$, i.e it goes out exactly the way it comes in. Now, Feynman, according to me, uses the law of conservation of momentum to deduce the following fact: If the particle moves out that way, then after the collision the momentum of the piston is $2mv_x$. However, this way, the law of conservation of energy is violated: If we sum the energies of the particle and the piston, then it will be greater than the energy before the piston.
What is wrong here? Is he doing something else?