Quite a thorny topic. I agree with your assessment. I guess every country experiences this "othering" process differently, but the fundamental discriminatory results are similar.
Here in Venezuela we are almost 90% racially mixed. Foreigners were welcomed and, probably as a result of internalize d racism and self-deprecation, even privileged. If they did not speak spanish or spoke with heavy accents, it did not matter. Most foreigners were hard working and locals admired them. They could make fun of their accents, but it was never to the extent of discrimination or exclusion.
On the contrary, because the country allowed hardworking people to prosper, foreigners developed their own class and had access to what locals did not. They were really in.
Things changed in recent decades and even though racial and economic markers might draw lines of inclusion or acceptance in certain settings, polítics is more of a factor now. Having the blessings of the dominant political class is the key that opens doors now, even if you don't speak a word in Spanish. Opposing it is the stigma that might get you fired, imprisoned, deported, exiled or killed, even if your spanish-speaking roots can be traced back to colonial times.
RE: Integration into Dysfunction