Curate, connect, and discover
Heimerdinger had to 'die' in the other dimension because if he came back with Ekko he would've derailed the entire arc with one sentence.
Heimerdinger, to Jayce: My boy...I'm afraid we have to go put my former assistant out of his misery. For the greater good.
Jayce [was about to go kill Viktor]: He's my partner. And I'm afraid I can't let you do that.
Heimerdinger: That's not up to you, my boy, but for what it's worth, I'm sorry it had to come to this.
Jayce: me too.
And then Heimerdinger gets the Salo special.
---
Basically, like what happens when parents tell their kids to clean their room RIGHT when they're about to do it themselves, Jayce loses all motivation to kill Viktor when Heimerdinger says it's the only option.