Your issue is discussed by the Ramma there, and his source. He quotes the Trumas Hadeshen #16 who used the idea of kavod habrios to relinquish someone praying publicly from moving four amos away, and from saying the yehi ratzon brought in the Mechaber.
What the Ramma didn't mention is that the Trumas Hadeshen specifically mentions a kol shekein for a shliach tzibur to be embarrassed.
The Trumas Hadeshen did say he thought it was hard to invent Halakhic ideas not mentioned or hinted to in the gemara and geonim.
But apparently the Ramma had no problem using this idea. However the Ramma did end off by saying one must wait for the smell to dissipate, something not specifically addressed in the Trumas Hadeshen. Apparently, the Ramma was not willing to rely upon this idea as concerns the smell.
If, however the person did not pass gas yet, and we are discussing holding himself back from doing so, the Trumas Hadeshen is willing to assume he can continue praying and there is no prohibition against praying while holding back bodily needs, which he is willing to accept is only said concerning urine and feces, when continuing to pray without first going to the bathroom makes his prayers a to'eyva, disgusting and worthless (see this article for halachic specifics and conditions).
As an aside, the Ramma seems to have liked this particular Trumas Hadeshen so much, that he weighed it against a Tshuva from the Rashba in siman 92 siff 2.