First off, laws of thermodynamics were declared, to end debate.

Carnot viewed heat engines like a waterfall. Goes in High, comes out low.
Analogy: High temperature in, low temperature out. And like a waterfall,
all the heat comes out. It just does work as it flows through.
Later it was 'Corrected' to comply with the 'Laws'. I believe he was correct.
The correcters were in-correct.
The textbook explanation of what's happening in a heat engine is, during
the expansion cycle, heat is turning into work. "That is why the temperature
drops." I believe the temperature is dropping because the heat in the expanding
gas is becoming less concentrated. But it's all still there.
To see what I mean, think of the reverse. If you compress a gas, are you concentrating
the heat or turning work into heat? If temperature rise in a gas compressor was
due to the 'work' converting into heat, then it would be impossible to create a
refrigerator.
To state it another way, if work were being converted into heat, it would be another
form of an electric heater. An electric heater does not cool.
If a heat engine does not consume heat, then energy is not conserved.
When you burn a fuel to release heat, you get all the heat - and you get some
work, "Free Energy" because you ran that heat through a heat engine.
This is common sense. Especially if you aren't programmed to reject it.
Physics struggles to explain the anomalies with the way heat acts.
They use phrases like "Potential to do work".
Consider this example:
Two blocks of steel. At room temperature. Connect a refrigeration unit
to draw heat from one and into the other. After a while, one block is cold
and the other is hot.
Remove the refrigerator and connect a heat engine. Stirling or Peltier.
For a little while, it will make make a small amount of electricity. Then
the blocks will reach the same temperature again and it will be done.
In this cycle, the blocks acted as a battery storing a portion of the electricity
which ran the refrigerator. In the last stage, some of that energy was
returned.
BUT, if you do not connect the heat engine, the stored energy disappears.
A heat engine is creating energy. And energy can disappear.
The carnot cycle (modern version anyway) models an Ideal Gas.
It does not document the maximum efficiency of a heat engine.
It documents the efficiency of a heat engine which uses a gas as
the working medium.
I once calculated the efficiency of a solid state heat engine. By solid
state, I mean changing the temperature of metal to do the work.
I started with a chart showing the thermal expansion of different metals.
And a chart showing the specific heat capacity of different metals.
Also the tensile and compression strength of them.
I picked magnesium or magnesium alloy (if I recall correctly) because
it had a typical heat capacity and strength, as well as and a fairly high
co-efficient of thermal expansion.
Steam can only do work while expanding. A bar of metal can do work
while being heated, and do more work while cooling. Most importantly,
it is less thermally-dynamic. It expands when heated. It does not, however,
react to compression or tensile loads.
So, I picked reasonable compression and tension loads for a 1" by 1" bar,
36" long. Also a reasonable (read practical) low and high temperature
for a heat engine cycle.
I then calculated how many BTUs of heat was needed to bring a bar
from the low temperature to the high temperature. As well as the expansion
distance (about 1/4"). Then with my compression and tension loads, I was
finally able to calculate how much power could be generated.
My answer came in at 12%. For 1000w in, it could only generate 120w.
But! It does not react to tension and compression loads. In other words,
it doesn't care about the load. If I ran the "Engine" with no load at all,
it would take the exact same amount of heat as it would if I were producing
the 120w. The amount of heat going in, is exactly the same as the amount
of heat going out. Regardless of whether or not I was drawing any power.
To be clear, If I heat a bar, and it expands and I place a high compression
load to try to resist the expansion, and use the expansion to do work, it will
take the exact same number of BTUs to heat the bar as it would if I placed
no load on it. The BTUs, and the ending temperature, exactly the same.
Now do you see what I mean about a heat engine not consuming the heat?
Next, the maximum efficiency of the engine is directly related to the choice
of working medium. The carnot cycle efficiency shows the efficiency of a heat
engine which uses steam as the working medium. It has nothing to do with
the efficiency of this engine. If I use a different metal, I get different results.
Now for the SUPER COOL part. After I'm done adding heat to the bar, and
harnessing the expansion, I start to cool the bar and it starts to shrink. I then
harness the shrinkage (with a tension load). When the load changes from
compression to tension, the temperature does not swing like the temperature
of steam does when it changes pressure.
So, if I start with the bar at 100 degrees F and at the high end it's 600 degrees F,
during the cooling cycle, it goes from a full 600 down to the 100. So it's still
high grade heat. I can re-use most of it.
So I take a pair of bars with opposite cycles. At the end of the cycles, one bar
is 100 and the other bar is 600. Then I thermally connect the two bars. So for
half of the next cycle, heat is traveling from the 600 degree bar into the 100
degree bar. This continues for half of a cycle until both bars are near 350
degrees. Now I separate the two bars thermally and then continue to heat the
rising bar to 600 and continue to cool the dropping bar to 100.
The bars are still completing the full cycle and performing the same amount
of work, BUT now I'm only putting in a little more than half of the BTUs of heat.
By changing the physical design, I've almost doubled the efficiency of the
engine. How many times have we heard that 'The carnot cycle defines the
maximum efficiency of a heat engine which means that no matter how you
build it, the maximum efficiency can not be changed".
So now my engine is at about 25% with two bars and with 50% recycling of the
heat. Now I make it 4 bars and do the same again but this time in two stages.
I'm matching a 350 degree bar with a 600 degree bar and a 100 degree bar
with another 350 degree bar. Now I have two bars at 475 and two bars at 225.
(Imagine diagram here). Then I connect a pair to meet in the middle and heat
and cool the other two get them to the ends of the cycle. Now 75% of the heat
(almost) is being recycled and the efficiency is about 50%.
I double the number of bars and stages two more times and I end up with somewhere
between 150% and 200%.
This engine would be difficult to construct but I could circulate silicone fluid or caster
oil through a rotary valve to accomplish the recycling with some effectiveness.
And even if real life efficiency of 8 bars was less than 100%, it would only have
to exceed the carnot efficiency for the input and output temperatures to prove that
the carnot cycle isn't a rule for all heat engines.
Like a solid, a liquid does not change temperature when the pressure changes.
And with a liquid, it's easy and effective to recycle most of the heat.
Those stories about overunity engines using oil or something liquid? They are true.
Now you know how and why.