The very end
I learnt the end of Toisfos with two alternatives - either even when they’re coming to convert there is chiyuv to displace them out of cities where Jews lived or that at the point they weren’t even coming to convert so it’s back to point zero where there is full chiyuv to displace (or to kill if you go like Rashi against the first Teirutz).
I assume you learnt the first answer as saying they would’ve kick them out for a discretionary reason and not that it is a mitzva, which would seem to make sense (and the Pashtus of the Gemera and Rishonim re לא יישב בארצך) but doesn’t add up because then Toisfos wouldn’t have to say לגרשן מעריהם - they could’ve just as easily thrown them out of the whole country - there is no issur to do that to Geirem or anybody. In the question Toisfos asked there’s no Chiyuv and the answer is that it was a Rishus. There is no benefit to change it from ארץ to עיר. It appears that in the answer Toisfos still held it’s a Chiyuv, and what changed from the question is that even though there isn’t a Chiyuv to displace from the country, there is from the city. It would also make sense that a Ger in learning should be further away.
In any case you agree that the Gemara according to Rashi and one answer in Toisfos says what I claimed, and there is Rishon that argues with the principle, only what the metizus was in that specific scenario.
A better argument would be that the Chilul Hashem here was only because they mistakenly assumed there was a mitzva, and it wouldn’t be a Chilul Hashem if they just assumed it was morally wrong for other reasons, though as you know there are other proofs against that
כיון דאמרו מארץ רחוקה וכו' - וא"ת בלא"ה מי חיילא שבועה והא הוי נשבע לבטל את המצוה דכתיב (דברים כ׳:ט״ז) לא תחיה כל נשמה
ואע"ג דאמרי' בירושלמי דשביעית פרק ששי אמר רבי שמואל בר נחמני שלש פרוזדוגמאות שלח יהושע לארץ ישראל עד שלא יכנסו לארץ מי שהוא רוצה לפנות יפנה להשלים ישלים לעשות מלחמה יעשה מלחמה גרגשי פינה והלך לאפריקא גבעונים השלימו שנא' (יהושע י׳:א׳) וכי השלימו יושבי גבעון את ישראל שלשים ואחד מלכים עשו מלחמה ונפלו היינו קודם שעברו את הירדן כדקאמר עד שלא יכנסו לארץ אבל משנכנסו משמע שלא היו יכולין להשלים ולכך הוצרכו להערים ולומר מארץ רחוקה באנו
וי"ל דעל כרחך באין רוצים להשלים כתיב לא תחיה כל נשמה כדמוכחי קראי (דברים כ׳:י׳-י״א) וקראת אליה לשלום וגו' ואם לא תשלים עמך וגו' רק מערי העמים וגו' לא תחיה כל נשמה
וא"ת מ"ט דרבי יהודה הא ודאי שבועה בטעות הואי ועוד לר' יהודה
איך הניחום בארץ הכתיב (שמות כ״ג:ל״ג) לא ישבו בארצך וגו' והוה ליה נשבע לבטל את המצוה וע"כ משום חילול השם הוא כדאמרי רבנן ו
י"ל דקסבר ר' יהודה דאי איתא דיש לו הפרה לא היה בדבר חילול השם
וא"ת בלא חילול השם נמי אין יכולין להורגן כיון דבאין להתגייר כדאמרינן לעיל (גיטין דף מה.) לא ישבו בארצך פן יחטיאו אותך לי יכול בעובד כוכבים שקיבל עליו שלא לעבוד עבודת כוכבים כו' ואמרינן נמי בפרק אלו נאמרין (סוטה דף לה
וכתבו להן מלמטה למען אשר לא ילמדו אתכם לעשות וגו' הא למדת שאם חוזרין בתשובה שמקבלין אותן וההוא קרא בז' אומות כתיב וי"ל דאי לאו חילול השם נהי שלא היו יכולין להרגן
היו יכולין לגרשן מעריהם ועוד דבאותה שעה לא באו להתגייר כי אם אחרי כן: