This assumes 1. automation is free, 2. humans cost too much, so any company would ditch their humans for AI. But in reality AI costs money, AI is better with people than without, and people can generate profits surpassing the cost of their wages. Why would a company prefer to reduce costs to increasing profits? When everyone has AI, humans are the differentiating factor.
All this science fiction is right; there isn't room on the planet for both humans and AIs. It sounds depressing that a bunch of GPUs are going to kill us all off, but it was coming anyway. The sun becomes a red giant and consumes the Earth. All protons in the Universe decay in 10^17 years, ending the existence of matter. The trajectory is clear even if the means aren't; humanity can't last forever.
If I sound depressed, I'm not really. People just use the headlines to guide their view on what The End looks like. Read a few articles about chatbots, and it's AIs taking all our jobs. Watch a few movies about asteroids, we go out like the dinosaurs. Hear "Russia invades Ukraine" and it's a nuclear holocaust. Read a few particle physics papers, and it's proton decay. You can't worry too much about it. Enjoy your time while you have it!
On the other hand humans are self replicators and only need a bit of biomass for sustenance, biomass that grows by itself, too. No factory, no supply chain, we got everything we need to make more of us.
If you consider the risk of EMP, an AI needs humans to restart it, or some way to survive electronic attacks.
for now
> If you consider the risk of EMP
if you consider the risk of a bioweapon ...