What happens at Spellhold if you leave Yoshimo behind?
The confrontation with Irenicus at Spellhold ends when...
Irenicus flees, leaving you to face another group of "murderers".
If Yoshimo was in your party and compelled to betray you, then he enters the scene after this and...
...attacks you. When you defeat him, you can take his heart to undo the Geas on Yoshimo, starting a quest to reconcile him with his god Ilmater and give him peace in death.
If Yoshimo was not in your party when you went to Spellhold...
...he will not be there to challenge you, leaving you free to escape.
In this case, then if you encounter him later on...
...he will immediately die because of his Geas. In this case, there's no option of reconciling Yoshimo with Ilmater since he drops no heart.
Sources: 1, 2