Not at all. In fact, I would make sure that I, as a PRIVATE CITIZEN, would not be present to hear such a prayer.
But we're not talking about "private citizens," we're talking about elected officials. They have no right to such personal expressions when they stand in that office.
Where is it written that an elected official gives up his/her right to religious freedom when they are elected?
So walking out and not participating in a group prayer is a personal expression of religion? And choosing to stay and bowing one's head in prayer isn't an expression of religion?
Of course they have a right to walk out. Whether they stay or they leave, they are expressing themselves, they are making a statement.