You are absolutely right. Automation and AI are changing the job market, and workers will need to adapt to these changes. As you mentioned, some jobs will be displaced, but new jobs will also emerge.
Everything that has advantages also has its disadvantages. Just like the industrial revolution led to massive job loss, robots will take over the jobs of humans which will lead to massive laying off of workers. But AI will also reduce the cost of production of goods which will bring down the price of some products.
Just like the computer age led to the creation of some opportunities in the computer sector, the use of AI will open up new jobs in the robotic industries. It might not be out of place for workers to diversify their skills through learning AI-related courses. This is because the AI industry might become one of the highest-paying fields in a few years.