Carnot’s theorem tells us that "the most efficient heat engines operating between 2 reservoirs have the same efficiency as a Carnot engine".
This theorem assumes that the engines are operating between reservoirs; in essence, it assumes that the 2 temperatures stay constant. However, this is not the case when an engine is operating between materials with finite heat capacity, because the temperatures no longer stay constant when heat is transferred.
I've heard of explanation to treat the temperature as constant so that the materials behave as reservoirs instantaneously. However, if the heat transfer over one cycle is large enough then the temperature will not be constant, so I think that this approximation will not hold.
Why does Carnot’s theorem hold even when the temperatures are changing?