This bug has been reported a few times. It is caused by capturing prisoners during a war — for example, capturing the enemy general — and then annexing the country you were fighting.
I found a temporary work-around for this issue until Paradox fixes it. When you end the war, choose the option to imprison all enemy leaders. Then find specifically those that are causing loss of stability and execute them. Then restart the game to force a recalculation of stability hits and you will be fine.
This is the only way to prevent the loss of stability. Do not free them, and do not sell them as slaves because if you do there's a chance that they will disappear from the game but continue causing loss of stability forever (that I know of).
Alternatively, execute the prisoners before ending the war.