But I've also seen this with American and some English adults trying to learn Norwegian - a great many of them can't hear the difference between vowels which, to me, are totally different. Can't hear the difference between the words "har" and "her", for example (NB: Norwegian sounds. Not English vowels). It seems to take a couple of years of daily ear training (or rather, brain training). As always, there are exceptions. But those exceptions are truly standing out.
(Added: As soon as there's context or visibility the problem is much reduced - but it's still there, as soon as there's only audio and their language level isn't good enough to "select" the right words from context).
Similarly in my (learnt as an adult) second language, there are a couple of vowel sounds that aren't in English and I usually have to really focus to hear them, and to pronounce them correctly.
As a native speaker, the sounds in peer/pair/pear/pier are slightly but detectable different. But non-native speakers can almost never say or hear these differences.
I mean, nobody is disputing "it gets harder as you become older". I totally believe that. Lots of things gradually become harder as you grow older, and language doesn't seem particularly different in that regard. The question is whether that's because your body "cements phonemes in place" around age 12, or whether there's something else at play that's likely gradual and not such a sharp boundary. The fact that it's rare might be just due to the (a) effort required to learn something new being higher in general, or the (b) perceived RoI being lower, or a ton of other factors that don't boil down to "your phonemes are cemented in place"... right? Anecdotally I know in at least one particular case that I observed and inquired about, that person (who's also very smart and hard-working in general) told me they made a very deliberate effort over a handful of years to improve their accent after immigrating, and that's how they sounded like a native now. I totally believe that many people are just unwilling to invest the effort required (which certainly increases with age). I'm just finding it hard to believe there's some biological force preventing you from doing it past age 12, given I've seen otherwise.
> it's more about the brain's ability to hear sounds (my wife can't hear the difference between a number of sounds despite having lived in my country for many years and speaking the language well).
That might be true for some sounds for some people, but I also have a hard time believing it's such a general thing to the extent you're painting it here. It seems more likely to me the explanation is something else, like maybe nobody has managed to give her a good enough explanation as to how they're different sounds. (Maybe not the best example, but I had a hard time distinguishing ch and s in German until someone explained to me how they're each pronounced. Now I can hear them much better, and pronounce them not-too-awfully too.)