For a reversible process, why is the production of entropy within the system equal to zero?
It is not the production of “energy” that is zero in a reversible process but the generation of entropy that’s zero.
Entropy is generated in a process as a result of disequilibrium between a system and its surroundings. Examples are pressure disequilibrium and thermal (temperature) disequilibrium. A reversible process is carried out slowly so that the system and surroundings are always in equilibrium.
Hope this helps.
See Transport Phenomena by Bird, Stewart, and Lightfoot, Chapter 11, Problem 11.D.1 Equation of change for entropy. They show that the local rate of entropy generation within a system is expressible as the sum of 3 terms, one proportional to the square of the temperature gradient, the second proportional to the square of the velocity gradient, and the third proportional to the square of the concentration gradient. In a reversible process, all three of these terms approach zero.