I believe the work will come from the kinetic energy of the gas at elevated temperature. Normally the kinetic energy is wasted, as pressure only increases linear to temperature, while molecular energy does not, as evident by the emission of visible light above a certain temperature, and phase changes.Still, if you calculate the joules going in to heat the box with the engine not powering an external generator outside the box and get a 20° temperature rise inside the box.
Then run the experiment again with the heat engine running a generator that powers a heater outside the box and get the same 20° temperature rise inside the box while also generating additional heat outside the box, then you would have a "spontaneous" generation of heat from nothing.
A miniature oxygen acetylene torch can cut though steel but could never heat your house through direct thermal transfer.
A fuel oil flame can heat your house but could never cut through steel.
A much lower temperature than either is actually required to heat your house.
The much higher temperature of the oxygen torch is representative of a much higher state of energy that required more work/energy to obtain. To only use the caloric heat(measured in calories or joules), would be a gross waste of energy. A much better use of the high temperature would be to force it to flow through a gas which allows that kinetic energy to be converted to work, while then allowing the total caloric heat to pass through with minimal losses.
I think Tom has been for years observing the conversion of nonlinear kinetic energy, not the linear scale of "heat" as we normally experience it. It stands to reason then that an external combustion engine cannot and never will measure high in "efficiency", and that the regenerator only serves to strangle these engines, which should be designed to allow energy to pass through, and not be recycled internally.
The ECE should then IMO have two forms. One is a low-tech design meant to scavenge low grade heat as it equalizes to ambient, the other is a high-tech design meant to convert very high temperature to high pressure. The latter is something that could benefit from someone like Elon Musk and SpaceX with their extreme temperature alloys and high-performance insulation tiles.