The saying out of the frying pan means to get out of a bad or difficult situation and into worse situation than they were already in.
So when someone says they got out of the frying pan they mean they left a bad situation but got into a worse situation by doing so.
It more commonly is referred to as getting out of the frying pan and into the fire which means a worse situation.
The phrase out of the frying pan was the subject of a 15th-century fable that eventually entered the Aesopic cano.