I fundamentally agree with your comment. But for Denmark, it is very difficult to learn Danish. I lived there 3 years, took courses and was at end able to do my daily stuff in English, but a part of the society simply does not want a foreigner to speak Danish. You are forced to use English.
My girlfriend asked me once in a Restaurant (Cafe Norden in Kopenhagen) why I was ordering in English. Then, I spent the complete evening ordering everything in Danish, to always receive answers in English. And this nearly everywhere (not my bakery, the girls there could not speak a word of English, this was an exception). This was in the early 2000's. This never happened to me in all the other countries I have been living in. A Danish colleague simply told me that he does not like to listen to broken Danish, better switch to English.
Still have a lot of friends in Denmark, integration there is not easy, even for highly qualified people from the EU.
Danes are by and large all English speakers, probably the last generation who would have much difficulty with conversational English are all 70+ years old now. And while Danes are generally very polite and friendly with foreigners, there is a level of personal closeness (part of the "hygge" concept) that you will rarely penetrate if you are not a lifelong close friend or family member. This is another part of why real integration into Danish culture is nearly impossible for a foreigner.
I observed over my 11 years in the Netherlands that the friendliness and quality of service I received was greater when I spoke English and much diminished when I spoke Dutch. The Netherlands is, similar to Denmark, a place where people would seemingly prefer to speak English than listen to an accent on their native language.
I had a similar experience in the Netherlands. We could have a 30 second exchange in their perfect English or a laboured 2 minute conversation in my abysmal Dutch. I struggled to improve because everyone would immediately switch to English.
I commend you for your efforts and I'm sure they were appreciated even by those who switched to English with you. It sounds like you were in the infamous long awkward intermediate stage of language learning. Depending on the cadence of your language classes, three years may not be a long time. Intensive language programs with daily lessons and drills are exponentially more effective than typical language-learning programs spread out across short sessions sprinkled throughout the week/month. In my opinion, it makes a lot more sense to place newcomers in intensive learning programs on arrival than to accept they will not be functional outside of ethnic enclaves, and wait decades for their children and grandchildren to finally integrate, as other commenters suggest. It's not an easy process and we can't expect everyone to have the intrinsic motivation to do it all on their own, which is why incentives are needed.
My girlfriend asked me once in a Restaurant (Cafe Norden in Kopenhagen) why I was ordering in English. Then, I spent the complete evening ordering everything in Danish, to always receive answers in English. And this nearly everywhere (not my bakery, the girls there could not speak a word of English, this was an exception). This was in the early 2000's. This never happened to me in all the other countries I have been living in. A Danish colleague simply told me that he does not like to listen to broken Danish, better switch to English.
Still have a lot of friends in Denmark, integration there is not easy, even for highly qualified people from the EU.