2 similar but different proverbs
They are both in chapter 28 of Proverbs.
“When the righteous triumph, there is great elation;
but when the wicked rise to power, men go into hiding.” – verse 12
“When the wicked rise to power, people go into hiding;
but when the wicked perish, the righteous thrive.” – verse 28
Notice verse 28 repeats the 2nd part of verse 12, and advances the the subject of the wicked rising to power:
They rise to power, and people hide.
But then the second verse takes us to another conclusion:
when the wicked perish, the righteous thrive.