How do pump spells interact with damage at end of turn?
...the pump spell wore off at the end step, but damage was not removed until the cleanup step.

There's your problem. &quot;...until end of turn&quot; actually means until the cleanup step - the actual end of the turn, not just the end step.


Cleanup Step

514.1 [discard to maximum hand size]
514.2. Second, the following actions happen simultaneously: all damage marked on permanents (including phased-out permanents) is removed and all “until end of turn” and “this turn” effects end. This turn-based action doesn’t use the stack.

So the damage and the pump go away at the same time, and all is well.