I don't think the change in the Mesoras Hashas is implemented to solve the problem. It's implemented because that appears to be the original text. The Munich Manuscript has the text of R. Yochanan's statement as "השמד" rather than "גזירת המלכות":

It looks like the word השמד was censored in the printed edition. In fact, we see a similar phenomenon in Rambam's codification of this law. R. Yosef Kapach writes that all the manuscripts have בשעת השמד:
אבל בשעת השמד וכו' כ"ה הנוס' בכל כ"י
Yet some printed editions have בשעת הגזירה instead. Notably, Rambam gives a definition of שעת השמד and the very definition he provides is that of a wicked king issuing a decree:
Hilchot Yesodei HaTorah 5:3
וכל הדברים האלו שלא בשעת השמד אבל בשעת השמד והוא כשיעמוד מלך רשע
כנבוכדנצר וחביריו ויגזור שמד על ישראל לבטל דתם או מצוה מן המצות יהרג
ואל יעבור אפילו על אחת משאר מצות בין נאנס בתוך עשרה בין נאנס בינו לבין
גוים
The answer to your question of how Rashi's explanation fits this may be in accordance with the explanation of R. Menachem Karokovski. He explains that Rambam is codifying this law specifically in a case where the persecution is on the Jews as a whole. If it's just a random persecution of an individual Jew, why should it make any difference whether the persecutor is a king or anyone else. In such a case we already established that the law depends on whether it is in public or in private. The factor about the king's decree is that that is something that is a persecution against the religion of the Jews as a whole, and that is where there is a special law that one has to give up his life even for minor mitzvot:
Avodat Hamelech, Hilchot Yesodei Hatorah 5:3
אבל כוונת רבנו במ"ש ויגזור גזירה על ישראל הוא כמ"ש לעיל ה"ב דדוקא אם
הגזירה היא על כלל ישראל משא"כ אם היא על היחיד דאז תלוי רק בפרהסיא
וצנעא דלענין היחיד מה לי מלך מה לי שאר עכו"ם אונס ותלוי רק אם יש שם
עשרה מישראל והרגיש בזה גם הרב מרכבת המשנה ח"ב והראיתי גם מקור דבריו
Thus, it is possible that Rashi agrees that we don't care about an individual Jew being forced to sin. The problem R. Yochanan is trying to avoid is that of encouraging religious persecution of the Jews as a whole, which is not an issue when a random person forces a Jew to sin – even if that person happens to be doing it as a religious persecution.