As far as I am aware this is a racist/xenophobic narrative with little to no evidence. Automatisation is responsible for job losses, not immigration. If you have studies/evidence saying otherwise please share.
I agree that too many people have shrugged at the human impact of "innovation" destroying communities as long as it didn't impact them. I believe the immigration/foreigners narrative is the successful attempt by capital owners who benefit from the real root causes.
It is neither racist of xenophobic, and you using that as a argument is an extreme strawman.
There is certainly a class that has been disrupted over the last 20-30 years to the point where their lives gone worse.
It would likely have been protected with trade barriers and immigration barriers.
Om the other hand, I don't believe protectionism has ever been the solution. Why should the domestic labor be protected over international labour?
Increasing inequality is, however, one of the greatest threats so society.
A quick search for "labor supply" turned up this microeconomics lesson: https://youtu.be/002_HEC2l-4?is=Tu6dZfNOyK7DFpWB
Wages, like all prices, are determined by supply and demand.