You’re confusing the forgiveness of sins/ removal of sins with the temporal punishment for FORGIVEN sins.
Being baptized, whether by water or desire, removes your sins if you are repentant for them. In other words, it does the same thing for the newly baptized person as Confession does for someone who was baptized years ago. It removes your sins.
However, Purgatory is not for removing unabsolved sins. It’s for the temporal punishment for FORGIVEN sins.
As we’ve said many times on here, picture a boy who is told by his father not to play ball in the yard because he might break a window. The boy disobeys his father, plays ball in the yard, and breaks the window. The boy is sorry, confesses to his father, is truly repentant for having disobeyed, and his loving father forgives him. Therefore, the relationship between the two of them is “fixed”. This is what Baptism does, or Confession with Absolution does. The sin is gone, the relationship with God is fixed.
However, the window is not fixed and still needs to have the glass cleaned up and be repaired. The father, who has forgiven the boy, therefore might make the boy sweep up the glass and contribute his allowance for a month to pay for the repair to the broken window. This is what Purgatory does. It fixes the “broken windows” caused by our already-forgiven sins, which have consequence beyond just affecting our own relationship with God.
Therefore, if you are baptized by water or desire just before dying, then you have a good chance of being SAVED. You are not punished for your past forgiven sins, punishment meaning you might go to Hell.
But you still might need to go to purgatory to pay for the consequences of your forgiven sins. Alternatively, God might decide you don’t need to go to purgatory because you have already served your purgaatory on earth, or you have perfect contrition for your sins. Let’s say that God decides you need some time in Purgatory; you’re already saved, because you will definitely be going on to Heaven.
So nothing “impedes your entry into the Kingdom of God”.
So the answer is that the person baptized by desire might get to skip Purgatory, and they might not. We don’t know for sure.
Baptism of blood is a little different because it’s thought that martyrs, those who give their life for God, have made a sacrifice so great that they might very well skip Purgatory. That is why martyrs can be beatified without a miracle.