Earlier quoted context omitted.
It works if you're learning the language while you're in a place where it's spoken.
But then one got to wonder why not spend that time learning in the wild. People have forgotten how it works I suppose. It would take less energy. There are a few options to learn a language. Some say immersion. What's most effective for the brain to capture and memories is _needs_. We tend to learn languages out of a desire to add them to our skill belt. Or out of fun. And we are having a hell of a time this way. Duo…
In my experience, most people need both some explanation of the fundamentals of grammar/pronunciation (formal education) combined with opportunities to use the language (immersion is perfect for this, but you can practice on your own as well). Figuring out what differences in Mandarin pronunciation are essential for meaning (tone) vs. which ones are meaningless, for example, is very difficult to do from immersion alone.
It's possible for the formal education to be in the target language, but if so it has to be very carefully designed. In my experience Duolingo does a somewhat decent job at the formal education part, but is more helpful if you had some formal education in a language, so you know what variations to look out for.
It sounds like you already had quite a lot of formal education before you had a chance to do immersion. Glad it worked for you!
Duolingo has been very effective for me, not because it's perfect, but because it's something I can actually do, while moving to a Spanish-speaking country or getting a job at a restaurant run by Spanish-speakers is not. Could I learn faster? In theory, but in practice it's the only strategy I've been able to stick with and I still am making progress. It's given me the foundation to practice using the language in other ways.
Language learning also requires you to actually be invested in the learning. I don't think any learning method works if you are totally passive. You have to be trying new things. You don't have to necessarily put yourself in a situation where you need to use the language. I've seen plenty of homesick people studying abroad who really need to learn the local language, but resent it, and end up sitting around learning nothing. But you do have to want to use the language. My German teacher was great at this. German had no practical applications where I studied, but we would play games, make jokes, and generally toy around with the language, which helped us push the boundaries of our language knowledge.