True Polymorph says:
Creature into Object If you turn a creature into an object, it transforms along with whatever it is wearing and carrying into that form. The creature's statistics become those of the object, and the creature has no memory of time spent in this form, after the spell ends and it returns to its normal form.
This appears to have no size limit. So, is there anything stopping a casting of true polymorph from turning an earthworm into a castle? Or a moon?
This question has been asked before: What is the upper limit for the size of an object that True Polymorph can change? There were legitimate objections to "can I true polymorph a mountain into a goldfish?", along the lines of "a mountain isn't an object". But the other direction doesn't seem to be addressed there; maybe a castle or a moon aren't objects, but a diamond the size of a castle pretty much has to be an object, and so it should be possible to turn a goldfish into a diamond the size of a castle, or the size of a country, or the size of the Sun.
This is clearly a munchkin question, and this sort of exploit would be disallowed by most DMs, but...it seems that this could be fixed with text such as "the object can be no larger than the creature", and it has not been so fixed. It's perhaps reasonable to allow 18th-plus-level magic users to create a castle with sheer power, and this true polymorph approach is one way of doing that, but creating the Sun is maybe a little too much.