-
Sure...
But here are in-wall speakers, the KEF Architectural ones and it's an 8" (20cm) driver https://uk.kef.com/products/ci200rs which only requires 4.7"/12cm of depth in a wall.
It is clearly possible to produce high quality speakers with shallow requirements on the cabinet, it only appears to be a choice to not do so.
Even the PSI Audio's on my desk have 4" (10cm) drivers and only have a depth of 6.7" (17cm) on the cabinet.
It's hard to even find great passive speakers which are shallow enough for a bookshelf and yet could fill a room with expansive and high quality music.
-
Of course it's possible, but both those examples are specific applications where dimensions are more important than acoustics. I'd guess in most rooms the depth of a stand mount speaker is rarely a problem.
The problem is semantic really, these speakers aren't designed to be on a bookshelf, just everyone calls them that.
There are lots of “golden ratio” cabinet designs that are shallower and wider / taller.
Cabinets are usually deeper to avoid internal reflections from the back panel. If they’re active that’s where the amp goes too.