She will certainly gain xp, but leveling is trickier
First off, we can't answer whether she SHOULD gain xp - that is a question for the DM, and it depends on their assumptions about the way the world works. What are XP awarded for? (combat? noncombat challenges? play sessions? milestones?) What do XP themselves represent? (actual experience? divine favor? increasing skill?) Whether a true polymorphed character should gain XP is an opinion-based question, or at least needs to be prefaced with lots of information about initial assumptions by the DM.
However, we can answer whether, RAW, a polymorphed character WILL gain experience, under the standard rules of combat xp, by examining the rules presented in the PHB and DMG.
Characters gain xp
As the PHB makes clear (p. 15), characters gain xp:
As your character goes on adventures and overcomes challenges, he or she gains experience, represented by experience points.
A polymorphed character is still a character, and is still going on adventures and overcoming challenges.
NPC characters gain xp
The DMG (p. 92) makes clear that xp are not just gained by player characters, however, but by NPC's as well:
Any NPC that accompanies the adventurers acts as a party member and earns a full share of experience points.
Previous editions of the game described how having NPCs accompany the party takes xp from PC's, but in 5e the NPC's themselves earn xp in their own right.
Even non-characters gain xp
Consider the spell Planar Ally (PHB 265):
That entity sends a celestial, an elemental, or a fiend loyal to it to aid you, making the creature appear in an unoccupied space within range...A creature enlisted to join your group counts as a member of it, receiving a full share of experience points awarded.
Thus even 'monsters' such as fiends, with no class and no levels of their own, earn xp when they accompany the party. If 'characters gain xp' and if even monsters with stat blocks gain xp, then surely a true-polymorphed character gains xp.
Leveling is a more difficult question.
The PHB (p. 15) says:
A character who reaches a specified experience point total advances in capability. This advancement is called gaining a level.
NPC's also advance when they have earned enough xp to do so (DMG p.92):
Since lower-level NPC party members receive equal party shares of XP, they will gain levels more quickly than the adventurers (the benefit of studying under such experienced masters), and might eventually catch up to them.
However, nothing indicates that the planar ally fiend accompanying the party would gain a level when it has enough xp, since it doesn't have a class 'to put the level in'. Does a true polymorphed character have a class 'to put its xp in'?
The true polymorph spell says that the recipient's:
game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality.
Based on the 'replacement of game statistics' phrase, most users on this site are of the opinion that a polymorphed creature cannot use any class features while in their new form. See, for example, Can a polymorphed creature use class features that don't require speech or hand gestures?1, as well as its duplicate Can you use class features while Polymorphed?
However, it is less clear whether the polymorphed creature, while polymorphed, has a class, and has class levels: see Does a caster under the effect of a True Polymorph spell retain their class levels?
Thus while it is clear that a polymorphed character would continue to earn xp, it is not clear what happens when they have accumulated enough to level - do they have any classes to level in? Note that the core rules make no assumptions about long rests, or training. A character levels immediately, as soon as they have the xp required to do so, so if the xp threshold was met while polymorphed, presumably the character would level even if they did not 'show it'.
While optional, the rules on Multiclassing (PHB p. 163 sidebar) offer this language:
Gary is playing a 4th-level fighter. When his character earns enough experience points to reach 5th level, Gary decides that his character will multiclass instead of continuing to progress as a fighter...Gary decides that his character will multiclass into the rogue class, and thus his character becomes a 4th-level fighter and 1st-level rogue (written as fighter 4/rogue 1).
Thus, at least when multiclassing is allowed, it can be seen that you don't need a specific class in order to level in that class. Gary had no rogue levels, and yet was allowed to place earned xp in that class and thus level in it. However, the Multiclassing rules also say (PHB p. 163):
The experience point cost to gain a level is always based on your total character level, as shown in the Character Advancement table in chapter 1, not your level in a particular class. So, if you are a cleric 6/fighter 1, you must gain enough XP to reach 8th level before you can take your second level as a fighter or your seventh level as a cleric.
If your xp cost to gain a level is always based on your total character level, and your true polymorphed form doesn't have a level, then there is no way to calculate how much xp you need. You might be able to gain xp, but unable to spend them to advance.
No good options for leveling
Ultimately the DM will need to make a decision as to whether the true polymorphed character can advance in levels or not. And here there are no good options, not because of the rules, but because of the consequences for play. And the more levels the non-polymorphed characters gain in the meantime, the worse these consequences become. Recall that in the OP's example, the non-polymorphed characters have gained ten levels while Morgan the wizard was polymorphed.
If Morgan has gained 160,000 and not leveled since 5th, does she suddenly level as soon as she is in her original body? What happens when she has more xp than needed to level twice? Can she take multiple levels simultaneously in 5e? In first and second edition, multiple leveling was not permitted - you took the first level and ended 1xp short of the second, with all the other xp being 'wasted'. This site has variations of this question for 3.5e and Pathfinder 1e, but I haven't been able to find the question for 5e.
If she is not permitted to take multiple levels at once, now Morgan is nine levels behind the rest of the party and has 'wasted' a mountain of xp. If she is permitted to take all her levels at once, it becomes a challenge to the verisimilitude - how has she suddenly mastered so many different abilities and features she has never practiced? Why is her 'original' body so much better than it was before (now with 4 points of ASI)?
The same problem of verisimilitude faces the game if the DM has allowed Morgan to 'level all along', increasing her wizard level but never using the new powers while she was polymorphed.
What I would do
Based on my experience as a DM, I would question the OP's premise - how did Morgan adventure with the party for the last ten levels? At 5th level, her maximum form was a CR5 creature (with Giant Scorpion and Minotaur CR3, Lamia CR4, and Xorn CR5). I don't doubt that the party could have kept her alive - 'keep the squishy NPC safe' is a well-known mission trope. But realistically, at some point a CR3 giant scorpion is no longer contributing to the party's success in any meaningful way. The bigger the level gap became between the party and Morgan, the fewer xp I would award her, simply because her participation was increasingly less relevant in each encounter. Thus when she was finally returned to her true form while the others were at level 15, she would be nowhere close to them in level. For me, this would preserve verisimilitude without 'wasting' her xp, since she had simply never earned that much xp. Further, as soon as it became clear that she was 'lagging behind' the other characters, the party would have been strongly incentivized to break the true polymorph, rather than waiting ten levels to do so. Even at level 5 they have access to dispel magic, and simply by repeatedly casting it on downtime days they would eventually hit the DC19 Arcana check needed to break the 9th level spell.
1However, see also this rebuttal, which argues that the blanket statement 'no class abilities' is too restrictive, and that some class abilities might actually be permitted based on the wording of the polymorph and true polymorph spells.