It takes hundreds of millions to build a warehouse. Amazon has tons of them. Retrofitting things is capital intensive.
On the other hand you can always hire more People to sort more packages. You don’t even need a building, a tent would suffice.
What these companies do is conceptually very simple. Basically sortation of items at different granularities and locations. Not comparable with manufacturing companies.
Robots also get cheaper over time because we learn. You can buy many parts in bulk including computer libraries to control them. You can find many people who know best practices who will not make some of the early mistakes that cost money.
It is strange how this isn't obvious