You're not an engineer, are you?
Moving parts, especially exposed moving parts, are subject to wear and tear, as well as contaminant ingress. The latter, in particular, is important in this context, with a critical part quickly sliding through a cutout in the chassis, as a speck of dust in the wrong spot can cause a jam if the tolerances are tight (which is an expensive prospect for mass manufacturing, as you have to buy machinery that can deliver on your requirements, hire people qualified to operate and maintain them well enough to keep delivering, and apply more stringent QA, with lower manufacturing yields as a result; these costs are then amortised over expected sales, which- at any level of performance- aren't going to be anywhere close to how many bricks Apple would sell if they just put their logo on them and said they're the bestest bricks ever), and if they're not tight, more dust gets inside, accumulating so the risk of a jam increases faster over time than it otherwise would.
A rigidly fixed mechanism is far more precise, reliable, durable and manufacturable.
Don't get me wrong, it's possible to "engineer to perfection", and that happens regularly at NASA, Lockheed-Martin and a number of universities and research institutions around the world, but they can't supply millions of units per year, which is what you're looking at if your smartphone isn't crap. So you need to manufacture rationally. Rails, bearings and actuators capable of performance, reliability and durability comparable to a rigidly fixed mechanism aren't available in the quantities needed, and the companies that have the expertise to manufacture them won't scale up to supply that many parts unless they're partnering with someone who can afford to invest a billion dollars up front in a joint venture. So you're stuck with inferior solutions, like simple cutouts and bearing surfaces.
I'm happy to roast Apple for yanking the headphone jack, but a pop-up camera is just a bad idea.
Better to just have a brow/notch or a forehead to hide the components in.
That much is obvious.
There's lots I don't like about them, but it's hard not to like a $1T company you can point at when someone claims you can't be environmentally conscious and turn a profit at the same time.