Immigration is a distraction from the real issues. If the left continues down that lane it will just continue to lose to the right because the right will always be better at blatant racism and telling people all their worries will be gone if we just kick out a few more undesirables (and just lower taxes a bit more).
If people feel secure in their jobs and/or income (because there will never be enough jobs for everyone anymore so we need basic income or negative income tax or whatever) they will care a whole lot less about immigration. But they dont, and parties like the AFD or Wilders in the Netherlands are great at deflecting that insecurity towards ''others'.
You can keep telling yourself that, just don't be surprised about the results. I'd urge you to go out into some of those areas with high right-wing turnout and talk to some of the people. Or read post-election motive polls from literally any recent election.