The nice answer by Mindwin handles the particular example well; but it partially sidesteps the problem by stating that any creature can squeeze in a 15×15 space, let alone a 30×30×30 volume. This is a correct statement as far as rules are taken as written. It also makes sense if we assume that D&D designers took real-life creatures as a means of gauging the possible sizes of living beings in general. The largest creature that has ever lived on Earth is the blue whale. It can be 170 tonnes in weight, assuming the density of water, that corresponds to over 6000 cubic feet. So even a blue whale would occupy about 20% of the total volume created by the Demiplane spell.
However, this answer might not satisfy those of us who play the game less from a gamist perspective, but more from a simulationist one. A blue whale is 100ft long, so while its total volume is small enough to fit, you would need to fold the poor animal. What happens in that scenario is up to each DM. The folding might harm the animal (possibly killing it) or the pressure by its body might be large enough that it tears the boundaries of the demiplane. In the case of the tarrasque, it being a siege monster and being able to consume just about anything, it would be logical to assume that it would attack the walls. Finally, we can always imagine magical creatures that are larger than whales or tarrasques; for example rocs have wingspans longer than 200ft; assuming the picture in the Monster Manual to be correctly proportioned, its abdomen alone is comparable in size to that of the tarrasque.
Hence, if we assumed there were a creature that would not fit into the space generated by the Demiplane spell (as the title of the question states), and assuming that it can still be targeted by True Polymorph (I write this as we have already gone beyond RAW creatures), what would happen at the end of the polymorph's duration is up to individual DMs. I would personally rule that (1) the creature will get compressed and harmed and possibly killed; (2) if the creature's 'pressure' is large enough to break the wooden/stone walls of the room, the demiplane's boundaries would be ruptured. In that case, just like a ruptured Bag of Holding, the contents could spill into the Astral Plane. (Or to the Ethereal Plane if you assume demiplanes are in the ethereal following the conventions of earlier D&D editions.)
The creatures would not be ejected to the nearest unoccupied space as the demiplane is not on the prime material plane. We read the casting of the Demiplane spell creates the space, and that we can connect to such spaces with future castings of the spell from other locations, this implies that the demiplane is not tethered to any specific location in the prime material.