My guess is that the Government will intervene when job losses increases at an alarming rate. Why? Because by then, tax collections from the middle class (working class) will drop significantly and they will be forced to provide aid to millions of jobless citizens. Imagine no new money but with added expenditure. Governments don't want things like that to happen.
You have very correctly pointed out one nuance that everyone forgets about when talking about "AI will take over the world and take away people's jobs" or "technology will leave the world without jobs".
First and foremost, AI, in the full-fledged form of Artificial Intelligence, does not exist today. This means that AI will not be able to set a goal of enslaving "primitive bio-organisms like humans"

Second, no less important - a fully technogenic world (when people as a labor force will not be needed) will lead to the extinction of the human species.
Thirdly, power is POWER over people, with the reduction of humanity, power will lose its "attractiveness" and its "advantages".
Like what you said - a drastic reduction of the middle class is a disaster for the state. That means :
- lower consumption (= slower idegradation of the economy)
- lower tax revenues
- increased social burden on the budget
But there is a nuance here - this is a problem for developed countries. In totalitarian and similar countries, the government just needs a silent mass, whose interest in life will be only the question of getting food to survive. And this is not the middle class, it is the lumpenized majority.
So that's what you're describing:
- is really important.
- but it's only important in a developed community.