From the spell description:
If you turn a creature into
another kind of creature, the new form can be any kind
you choose whose challenge rating is equal to or less
than the target’s (or its level, if the target doesn’t have a
challenge rating). The target’s game statistics, including
mental ability scores, are replaced by the statistics of
the new form. It retains its alignment and personality.
...
The creature is limited in the actions it can perform by
the nature of its new form, and it can’t speak, cast spells,
or take any other action that requires hands or speech
unless its new form is capable of such actions.
The target’s gear melds into the new form. The
creature can’t activate, use, wield, or otherwise benefit
from any of its equipment.
If this is read exactly as it is written, then the new form is the creature. For example, if you are a 17th level Wizard and cast the spell on yourself to make you a 17th level Cleric then you have all the statistics of a 17th level Cleric and none of the statistics of the 17th level Wizard.
Clearly these have exactly the same number of slots per day but different spells. You question is what happens to the slots expended by the wizard, for example, the one used to cast true polymorph?
First, it is not entirely clear and therefore subject to ruling by the DM.
However, it seems to me that the only sensible option is that the "new form" is exactly that, a new form with all spell slots available. To rule otherwise invites madness, what if instead of originally being a full spell caster like a wizard, it was a semi-spell caster like a ranger - or the transformation went from wizard to ranger. Don't even think about how to handle a warlock!
This is the simplest and cleanest solution, anything else invites so many exceptions, corner cases and "But what if ... ?" that it would become unmanageable.
There is an argument that this interpretation makes the spell very powerful; to which I say:
- It's a 9th level spell - they are supposed to be powerful!
- The CR or level must be equal or less than the original - in effect, it involves swapping out one character for another.
- The new form can only cast 1 concentration spell, this ends the polymorph.
- "The creature can’t activate, use, wield, or otherwise benefit from any of its equipment." Unless the wizard thought to remove their component pouch first, the cleric is limited to V & S spells only until they can find a component pouch or divine focus. Similarly a warlock would have no pact of the tome etc. etc.