Energy Shaper doesn't work properly with Loatheb effect

  1. Your opponent plays Loatheb and this brings cost of one or more spells in your hand above 10 mana
  2. Next turn you play Energy Shaper

Expected behaviour (as I understand mechanics): spells whose cost went above 10 mana are converted to the spells with 10 mana cost. At the end of turn their cost reverts to original

Actual behaviour: spells does not change, their cost is raised by 3. At the end of turn spell cost cut by 3 and stays the same it became under Loatheb effect

I think you’ve been confused by how the mechanic works and by what “original cost” means.
The original cost is not the base cost of the card being transformed, it’s the current cost of the card before transformation.

Let’s say you have a 3 mana arcane intellect in your hand. That’s a base 3-cost spell that currently costs 3.
If you play Energy Shaper, it will transform into a random base 6-cost spell (current cost + 3) that has its current cost changed to 3 : its original current cost before transformation.
If you play Energy Shaper again, it will turn into another 6 cost spell that costs 3, because what matters for the transformation is the current cost.

If you now reduce its cost by 1, it is now a 6 cost spell that costs 2.
If you play Energy Shaper again, it will turn into a 5 cost spell that costs 2
If you increase its cost by 5 it’s a 5 cost spell that costs 7
If you play Energy Shaper, it will turn into a 10 cost spell that costs 7

The previous explanation may be unnecessary but it’s to be sure we’re on the same page for that part.

By transforming the spell, you are actually resetting all of its enchants, same behavior as transforming a minion on board.
Since Loatheb is an aura, its effect is permanent during your turn, meaning it will re-apply post transformation.

So in the last example, if the 5 cost increase was because of Loatheb, after transforming your spell into a 10 cost spell that costs 7, its cost will increase again from the loatheb effect to 12, and get back to 7 when the turn ends

Back to your case : you had a 5 cost spell, increased to 10 by Loatheb, transformed by Energy Shaper into a 10 cost spell (because there’s no 13 cost spell) that costs 10 (the current cost before transformation, aka original cost), increased to 15 by loatheb’s effect reapplying after transformation, brought back to 10 once the effect ends.