There are no rules for this, so it's always going to be up to the DM.
Polymorph can be used on "a creature you can see", with no further restrictions. It (for all intents and purposes) automatically fails against shapechangers and creatures with 0 hit points, but that's as far as it specifies. There's one clause in Polymorph which could be argued to apply here:
The
target’s
gear
melds
into
the
new
form.
The
creature
can’t
activate,
use,
wield,
or
otherwise
benefit
from
any
of
its
equipment.
So if your DM considers a swallowed creature to be "gear" (unlikely), it would meld into the new form. Otherwise, Polymorph has no rules for this situation.
As you've noted, the rules within each creature's statblock have nothing that covers this situation either. It's noteworthy that, while each of them can only swallow creatures of a certain size, there's nothing that says what happens if a creature they've swallowed grows beyond that size. So, as a DM, I could certainly see an argument that when a creature you've swallowed becomes too big for you, the swallow ends messily.
Another point to consider about the rules for swallow within each creature's statblock are just that - within each creature's statblock. There are no global rules for swallow. Well, so, what?
The
target’s
game
statistics,
including
mental
ability
scores,
are
replaced
by
the
statistics
of
the
chosen
beast.
This means that, once Polymorph is cast, the rules that allowed the creature to have another creature inside it have ceased to apply to that creature. What does that mean? The only sensible way to deal with this paradox is to accept that the rules just don't cover this and the DM is going to have to decide what happens.
RAW, no matter our answers, the result is (nearly) the same!
Your question is an excellent one, and a fascinating edge-case interaction between two spells. But as surprising as it may seem, no matter our answer the outcome will be the same: whether or not the original Conjure Elemental spell is "extended" (or, "refreshed"), the elemental in question will remain on this plane for the 24 hour duration of Planar Binding, under the control of Planar Binding's caster! The one difference is that in one case, the Elemental will disappear after the 24 hour duration, and in another it may not. Let's consider the details below:
For the purposes of this question, let's assume that the caster of Conjure Elemental (CE) may not be the same person who cast Planar Binding (PB): designate a Warlock as the one who cast CE (via an Invocation), and a Wizard as the one who cast PB. Let us also assume that the Conjure Elemental spell was cast 40 minutes ago, then the caster of that spell lost concentration and Planar Binding was immediately cast by the Wizard casting Wish, precisely emulating the Planar Binding spell (so that we don't run into problems with PB's usual 1 hour casting time, which normally would mean the elemental disappeared before PB was done being cast). Now we can consider the two possible cases.
Case 1.) The Conjure Elemental spell's duration is "extended", and thus is still in effect for 24 hours
It's debatable whether this makes sense. Can you "extend" a spell that is already over? For the sake of argument, we'll ignore that question for the moment (returning to it later), and focus for now on the mechanical effect of this "extension."
First of all, note that the Warlock is not forced to concentrate on the Conjure Elemental spell for the next 24 hours. Concentration is part of a spells duration. Planar Binding has changed the duration of Conjure Elemental " to match the duration of" Planar Binding (PHB, p. 265, Planar Binding). Thus, Planar Binding did not extend the Conjure Elemental spell to "Concentration, up to 24 hours": it extended it to "24 hours". So the extended Conjure Elemental spell no longer requires concentration on the part of the Warlock (or the Wizard).
Normally, the Warlock who cast CE would be in control of the Elemental for the duration of CE. But "specific overrides general," so while PB is in effect, the Wizard will control the elemental. And as per the text of Conjure Elemental (PHB, p. 225, bold added):
The elemental disappears when it drops to 0 hit points or when the spell ends.
Thus, at the end of the 24 hours (from when PB was cast), the CE spell will end, and the elemental will disappear.
Thus, if the Conjure Elemental spell is "extended" by Planar Binding:
- The caster of PB controls the elemental for 24 hours
- The elemental will remain on this plane for those same 24 hours
- The elemental will disappear in 24 hours (from the casting of PB).
Now let's consider the other case.
Case 2.) The Conjure Elemental spell can't be "extended," and Planar Binding is the only currently active spell
Now in this case, the elemental will still obey the Wizard who cast PB, since according to the text on Planar Binding (PHB, p. 265):
A bound creature must follow your instructions to the best of its ability... The creature obeys the letter of your instructions, but if the creature is hostile to you, it strives to twist your words to achieve its own objectives.
Note that if the Wizard is an ally of the Warlock who cast Conjure Elemental (and lost control of it), the elemental may be hostile to the Wizard. But that's a minor point.
The important question at this point is how long does the Elemental actually remain on the Wizard's plane? It will remain in your service for 24 hours, the Elemental could still be bound to your service when a magical effect whisks it away to another plane. As strange as it may seem for a spell called "Planar Binding" (PB), the PB spell doesn't specify that it keeps a creature on any particular plane. A fire elemental could be shunted back to the elemental plane of fire still under your control. It might just stand there for PB's duration going "well, master will surely give me instructions soon."
So the question becomes, will the elemental remain longer than the next 20 minutes? Let's look at the text of Conjure Elemental for guidance. First, we know that it will normally disappear "when the spell ends." But as you noted, there is an exception (PHB, p. 225):
If your concentration is broken, the elemental doesn’t disappear. Instead, you lose control of the elemental, it becomes hostile toward you and your companions, and it might attack. An uncontrolled elemental can’t be dismissed by you, and it disappears 1 hour after you summoned it.
Since the Warlock lost concentration on CE, the elemental doesn't disappear (although the spell has ended). Then, the Wizard took control of the elemental via Planar Binding. You might think that the elemental will disappear in twenty minutes (since it's been 40 minutes since it was summoned originally). But the clause in the final sentence only applies to uncontrolled elementals: and the elemental is no longer uncontrolled! It is currently controlled by the Wizard. And the original clause that the warlock's "concentration was broken" still holds, so it "doesn't disappear"!
Thus, in this second case where the Conjure Elemental wasn't "extended":
- The caster of PB controls the elemental for 24 hours
- The elemental will remain on this plane for those same 24 hours
Same as before! Except... then what happens?
So if Conjure Elemental wasn't extended, what happens when Planar Binding wears off?
Now we come to the one tricky part. Then 24 hours later, the Wizards control of the elemental will end. Now, the elemental is once again an "uncontrolled elemental", and is subject to the clause in the previous Conjure Elemental spell. As an uncontrolled elemental, it disappears "one hour after ...[it was] summoned." Strictly speaking, 24 hours (and forty minutes) is not the same thing as "one hour after." Some DMs might rule that any time more than an hour after something counts as "one hour after" it. Others might rule that there is a difference between "one hour after" and "after one hour" (the later of which would definitely include all times greater than an hour afterwards).
After the 24 hours are up, the Elemental may simply remain on this plane, hostile to either the Warlock, the Wizard, or both. Or it may disappear if the DM decides that "one hour after" includes the time later than an hour after, or decrees that the elemental's disappearance was suppressed while it was controlled, but is now activated again. The safest option for the caster of Planar Binding would be to give the elemental an order to destroy itself as quickly as possible (without harming anyone else) in the last few minutes of that spell's duration (for example, ordering a Fire Elemental to jump off a cliff into the ocean and swim as far away as possible). This should make the one point of uncertainty mostly moot.
So which happens? Case 1 or Case 2?
Unfortunately, your DM will have to decide. One could argue that the elemental definitely "was brought by another spell" so that spell's duration is now extended. But on the other hand, you could argue that even if a spell's duration is extended, that doesn't change whether or not the spell is currently over. But you could retort that it does, since the Conjure Elemental spell is no longer concentration, which is what caused it to end in the first place. But then you could say that a spell that is no longer active can't be "extended," because there is nothing to extend. And so on back and forth.
Personally, I suspect that Case 1 (where CE is "extended") is more likely to be in line with the intended function of Planar Binding, and also more likely to create a simple situation with no ambiguities, so as a DM it's the case I'd be more likely to chose. But ultimately, it will be up to your DM to decide which of these two cases will apply. But in either case, the results will be surprisingly similar.
Best Answer
This answer is not RAW, but RAW probably does not answer your question.
In the real world, slime mold moves, but very slowly. With regard to combat, they are functionally immobile. With regard to life cycle, it's entirely possible they could climb back up to the ceiling in a few hours.
Alternatively, it could be part of its life cycle. Green slime may need to consume an animal in order to reproduce. They collapse onto an animal, kill it, then use the abundant nutrients to form fruiting bodies. These release spores into the air, which attach to the walls and ceiling and form more green slime. The slime on the ground dies, its purpose fulfilled. You can basically think about salmon swimming upstream, spawning, then dying, except instead of a stream, it's a person.