Pretty sure ruby is back next season, right? And that the new companion is an addition not a replacement.
Ruby stopped Gwilliam because the doctor was gone. When she saved the doctor by stopping him from stepping on the fairy circle, that timeline was wiped out and ruby had a different life where we now see she meets her parents and doesn’t keep travelling with the doctor. But Gwilliam still happens, so the doctor stops him instead.
I think sutekhs decision on when to return was related to the whole thing about the Susan Triad on Earth being much more powerful due to the doctor coming back a lot. And Ruby isn’t departing the show.