It is a quote from Psalm 25:3: "Yea, let none that wait on thee be ashamed: let them be ashamed which transgress without cause".
Also it resonates with the Psalm 17:14-15 (16:14-15 in Septuagint), in which David separates himself from those who are satisfied with ungodly things, whereas, in contrast he himself will be satisfied when the glory of God appears, with an implication that those who were satisfied with ungodly things will be put to shame when the Glory of God appears.
The Lord also says Himself that if anybody will be ashamed of His commandments, He will put to shame such ones in front of His angels (Mark 8:38).
Thus, it does not look like that shame is connected with persecutions, unless only obliquely, as one of the many possibilities of implication, with a logic that, "Lo, we Christians are persecuted and thus considered shameful by those earthly people and persecutors, however real shame will befall them, when Lord comes and we shall be satiated by His glory, whereas our persecutors will be ashamed."
But to put aside persecutions, which are not at all necessary in this context, one can say that all humans will be put to shame unless they cultivate Christ's commandments, for who does not gather with Christ, he scatters (Matthew 12:30).
Imagine, in the Democratic Republic of Guanto-Munchacho a famous economist issues a prophetic warning that the local currency Muncha (100 Munchas=1 US dollar) will be devaluated and it is prudent to exchange it to US Dollars. Now, most of the Guanto-Munchachoans do not believe this economist and laugh at those who exchange Munchas for the US dollars. However, when the inflation will come like a tsunami, then those who laughed at the US dollar-gatherers will weep, while the US dollar-gatherers who were derided before, now will find their pecuniary safety, respect and riches. The same in Christianity: those who are afflicted here while gathering with Christ will be glorified with Him in eternity, while those who get rich here without Christ and deride the faithful Christians laughing at them with words: "if you are smart, why are you poor?", such ones will be ashamed at the advent of Christ.
p.s. The Democratic Republic of Guanto-Munchacho does not exist, I invented it for the sake of an analogy.