I'll break it down so it's a bit easier to understand...
1. Uxie attacks Froslass with Psychic Restore. Froslass currently has 7 damage counters on it.
Damage is applied first, and then effects. Psychic Restore does 20 damage, so now Froslass has 9 damage counters on it.
2. Put 2 damage counters on Froslass for the 20 damage you did. Froslass currently has 9 damage counters on it.
Your attack isn't finished yet at this point. Psychic Restore has an effect. Let's say you invoke that effect and put Uxie at the bottom of your deck.
3. Per the effects of Psychic Restore, you choose to put Uxie at the bottom of your deck.
You need to replace Uxie with someone, or else you lose.
4. Promote your new Active Pokemon.
Now your attack is finished, but your turn is still not over. It's at this point that KOs are checked on all Pokemon in play. Froslass has 9 damage counters on it, so it is Knocked Out.
Froslass's Destiny Bond targets the Defending Pokemon at the time the attack was used - in this case, Uxie. Since that target (Uxie) is no longer in play, the Destiny Bond can't trigger.
5. Froslass has a sad face and dies without taking anyone else with her.
If you choose not to invoke Psychic Restore's effect, then Froslass would take out Uxie because Uxie is still in play when Froslass was KOed.