Citation very much needed.
For instance Russia is socially and politically conservative, mostly "racially" (everyone is "white" because according to you that matters) homogeneous, anti-immigration (outside of limited amounts of labourers from the former Soviet republics), yet... it's not safe nor clean nor developed. Same can be applied to a host of different countries across the world.
Racism exists in countries like Japan too. Except the number of non-Japanese (or non East Asian who can often pass for Japanese) are statistically so insignificant that it is far less of an issue than say, the US.
Both a melting pot society and a homogenous one have their pros and cons. I love the former, but I also don't pretend to think there aren't serious cons to a melting pot and pros to a homogeneity.
Meanwhile there are some differences, especially in policy, that are very easy to link to crime: Japan has practically no guns. Japan has universal healthcare. The US has a poverty rate of over 10%, while Japan has a poverty rate of under 2%. Japan builds housing. Japanese public education is much more equitable and supported by the national government.
Why is Japan able to do that, and the US isn't?
When practically everyone is a fellow Japanese, you don't have people griping about universal healthcare (or social safety nets in general) benefitting the "other" who "don't deserve it".
Or feeling that you need to own guns to "protect yourself from the other".
You're proposed link from homogeneity -> gun control is completely unsupported.
But a lot of pro-gun advocates cite that they want guns to protect themselves.
My general point stands. If everyone around you is part of your "in" group, you're more likely to be willing to help them out and less likely to see them as a threat.
I would like to believe that most people are able to transcend racial, ethnic, religious, or even national boundaries to help their fellow man.
However, reality shows me this is not the case.
This is not true, and not possible in practice. In any seemingly homogenous group there are various subgroups, often at odds with each other for whatever reason. It's just human nature.
Harmony has more to do with local culture, the economy and other quality of life issues. Have a look at a place like Australia, which has little conflict overall even though it has a large and growing immigrant population. That has to do with an egalitarian culture and being a fairly wealthy country with nice weather.
A more enlightening statistic is that about half of Australians have a parent that was born overseas, which means they have an ethnic background.
https://www.abs.gov.au/media-centre/media-releases/2021-cens...
But what is "local culture"? It's made up by the local people. In a homogenous society like Japan, it's Japanese culture.
In a melting pot society like the US, it's a mix of the product of old European immigrants that have mostly merged and assimilated with each other, African Americans forcibly brought over via the slave trade that emerged with their own culture, and finally combined with more recent arrivals from Asia/Africa/Latin America who are much less assimilated.
When one or more cultures meet, sometimes they adapt positively. Sometimes they adapt negatively. When you have so many cultures mixed together, there is bound to be friction.
That doesn't necessarily mean violence, but it can be something more subtle - like certain races or groups resisting interacting with each other beyond the bare necessities. I wouldn't be surprised if this is true in Australia too.
I'm Asian American, and I am ashamed to admit I have zero African American friends (I have Black friends, but they are all more recent African/European/Caribbean immigrants). Cultural norms and upbringing has a lot to do with it. At the risk of sounding too clinical, one of my goals is to genuinely befriend more African Americans.
Your view suggests you think that people rigidly stick to whatever culture they're born into, but that's not the case. The longer people stay in a country the more the local culture seeps in. The children of immigrants typically adopt the local culture, even if it has a ethnic flavor.
So there is a natural trend toward the local culture. If your view were true countries with permanent large immigration programs such as Australia, Canada and the US would over time become balkanised, but that's obviously not the case. Different ethnic groups tend to an understanding of each other rather than conflict. There isn't naturally friction due to ethnic differences, just like religions don't tend to be add odds with each others members.
You don't need to have friends from other ethnic groups, or a particular ethnic group, just like you don't need to have friends in other political or religious groups. Life isn't a bingo card. All you need to do is subscribe to a few common fundamental values, and that's generally easy for people in a given country to do, even if it takes some time.