They would be unable to try again.
As noted learn a spell states:
Critical Success You expend half the materials and learn the spell.
Success You expend the materials and learn the spell.
Failure You fail to learn the spell but can try again after you gain a level. The materials aren’t expended.
Critical Failure As failure, plus you expend half the materials.
This means that a level 20 sorcerer would be unable to try again since there aren't any rules for going beyond level 20 and thus the would be unable to get the level neded to try again.
Magical Shorthand states:
Learning spells comes easily to you. If you’re an expert in a tradition’s associated skill, you take 10 minutes per spell level to learn a spell of that tradition, rather than 1 hour per spell level. If you fail to learn the spell, you can try again after 1 week or after you gain a level, whichever comes first. If you’re a master in the tradition’s associated skill, learning a spell takes 5 minutes per spell level, and if you’re legendary, it takes 1 minute per spell level. You can use downtime to learn and inscribe new spells. This works as if you were using Earn Income with the tradition’s associated skill, but instead of gaining money, you choose a spell available to you to learn and gain a discount on learning it, learning it for free if your earned income equals or exceeds its cost.
This means that a level 20 sorcerer with Magical Shorthand could continue to attempt to learn a spell every week until they succeeded.
: There aren't any rules for going beyond 20 as far as I'm aware, though I could be wrong.