In my view, learning an instrument has a lot in common with learning to code, in that some people take to it, and others don't. And we probably know some of the reasons, but not all of them. Of course teachers and teaching programs vary, as do kids and their family milieu. But nonetheless, music education has huge attrition.
For instance, by way of anecdata, I took string lessons as a kid and loved it, and my kids have gotten pretty serious on violin and cello. They actually like classical music, and it probably helped that both of their parents also enjoy it. So it definitely works for some people.