But since the technology is already known and available, the cycle would be much faster and the shift could happen multiple times during 1 generation, making such reality impossible to live in.
Good point, if it is quick the current generation won't be able to adapt fast enough. So yes, if it is too fast, there will be some instabilities, but it will be temporary, with technology people are adapting faster and faster. (at the extreme, my job as a developer put me in an environment where I will not use 95% of what I know today in 5 years... and well, I have to adapt)
If decline in demand will increase maintenance cost
Why ? if you AI is making 300 apples, why would the AI cost more to maintain if demands is 100 rather than 200 ?
In a competitive environment, the price of a good tends to be equal to the cost of operation. A race to the bottom.
But for the sake of argument, let's say that producing surplus cost money (for example, in oil, increase of cost of storage)
then those costs will be passed onto customers by raising prices of food.
A decline in demand exert a downward pressure on price, not the reverse.
Take the example of Oil, the surplus of oil have a downward pressure on price.
Because if decline of demand increase "maintenance cost" as you said, then it becomes economically profitable to dump your stock, even at a loss.
In any case, if the pressure on price by customer is so that the cost of maintenance is above the price that customer would be willing to buy, then the business of making the factory run on AI will collapse.
How would it be replaced by human ?
Simple : if customers are poor and can't buy an AI produced apple, then they will simply start growing their own apple. (which by definition will have a lower cost, since they will always afford to grow their own apple trees)
This will bring back humans at work.
The equilibrium of AI factories versus Human factories only depends on the cost of AI versus cost of human labor.
However, the lower the cost of AI will become, the higher the chance that everybody will be able to profit from it, and, at an extreme point, working for money would not be required anymore and the unemployment problem is not relevant. (I don't think it will ever happen)
Anyway, the equilibrium at 100% unemployed is purely academic discussion
It is, but jobs is not what provide wealth, products and services are (robot or human produced), by keeping that in mind, 100% unemployement might not be a big deal.