Mandarin is weird, because I don't think it's that hard to speak at a passable level, mostly because the grammar is so simple. Many people are spooked by tones, but I think their importance for simple communication can be a little overstated.
But then, learning to read and write requires enormous additional effort. When I learned in Beijing, I'd spend a couple hours a day working on grammar/speaking/listening - and then like 6 hours a day of rote practice to get familiar with characters.
I learned it in high school and university as European and I can speak decently. China isn't that good of a place for foreigner due to difficulty of getting permanent residency/citizenship. Hong Kong is the exception but the economy is not too hot there now.
I moved to Singapore although it had nothing to do with my language skills.
Even if I was fluent in mandarin, China still wouldn't be in my shortlist of countries to move to due to low salaries in engineering, poor working conditions (996), authoritarian government, etc.
Learning mandarin is the major blocker imo, more people would move if the language was easier.