Let's start with the fact that a demiplane created with this spell is either on the Astral or Ethereal Plane (caster's choice).
For an Ethereal Plane demiplane: to the location of the casting.
We know from Pathfinder: Planar Adventures (PA), page 95, that "Ethereal creatures can perceive objects, terrain, and creatures on the Material Plane as wispy, ghostlike images... The ability to move through solid objects on the Material Plane gives an ethereal traveler incredible mobility." Further it states that the Ethereal Plane is "most often used by mortals as a means to move [across the Material Plane] incorporeally and unseen..." From this we can infer that at least some part of the Ethereal Plane coexists spatially with the Material Plane. Put another way, one point on the Material Plane corresponds to one on the Ethereal Plane. This is important when you consider that the range of the spell is 0 feet, which seems to indicate that Create Demiplane cast on the Material Plane with the caster choosing to create his demiplane on the Ethereal Plane will create the demiplane at the point on the Ethereal Plane that corresponds with the location of the casting. If one is ejected from a demiplane on the Ethereal Plane into the Material Plane, it is logical that it would be at the location that corresponds to the demiplane's location on the Ethereal Plane. So what we know about the spell's range and the Ethereal Plane's spatial relationship to the Material Plane supports the conclusion that the ejected being appears where the spell was cast.
For an Astral Demiplane that the ejected creature reached via Astral Projection: to the location of the ejected creature's material plane body.
PA's desription of the Astral Plane on page 149 describes it as a "matrix of metaphysical material" and likens it to tectonic plates on which the Outer Sphere revolves around the Inner Sphere (where the Material Plans is). So it is described as separate from the Material Plane. Further, it is described as being "churned" by the Plane of Fire and stirred by the River of Souls, which creates powerful currents. Not only does the Astral Plans not coexist spatially with the Material Plane, it moves around the Inner Sphere and things like demiplanes may possibly move around within it.
This is not a clear situation to adjudicate, but the rules give us at least one easy scenario: a creature being ejected that traveled to the demiplane via Astral Projection from the Material Plane. In that case, they still have the silver cord binding their Astral body to their physical body and if sent back to the Material Plane, the cord would draw them back to their physical body, wherever they left it when affected by the Astral Projection spell.
For an Astral demiplane that the ejected creature reached by means other than Astral Projection: No good, supportable answer, so... GM's choice.
As for creatures not tethered by a silver cord to the Material Plane, their destination seems much more in question. Given the volatility and motion of the Astral Plane (as described in PA) in relation to the Material Plane, a random location might be the most logical answer, though it is far from the best. Mathematically speaking, a random location on the Material Plane is almost certainly going to be the void of space. Even if you avoid the vacuum, you're still almost certain to wind up somewhere that will kill you (the surface of a sun, embedded inside solid matter, mid-air 30,000 feet over very sharp rocks...).
So which possibility is best supported by the rules?
- A truly random Material Plane location is basically a death sentence. It might technically be the "correct" answer, but in game terms it's a bad answer. If RAI was that the ejected creature has a 99.99...% chance of death, they probably would have just written that the ejected creature would be killed.
- Sending the being to the location of the casting is a weak option in my opinion, since unlike with an Ethereal demiplane, there is no logical reason they'd be ejected to that point. Furthermore, it would be a bug in the spell's code since it would probably be undesirable for the caster who created the demiplane. If he created the demiplane in his nice, secure tower, does he really want intruders being sent there if he expels them from his demiplane?
- You could allow the creator of the demiplane to choose where the ejected individual winds up, but that is not explicitly stated in the spell description and it could take us back to point 1 in many cases: death sentence.
- I think the best option is a pseudo-random location chosen by the DM that maximizes fun, advances plot, and avoids the high probability of instant death. In theory, it is logical, and it improves the GM's control of the game.