The situation described above is one that caused all kinds of issues when I managed a bar.
We treated non alcoholic beers in the exact same way as we treated alcohol. There were 2 key reasons but they are largely connected and a lot of shops and bars do similar. The packaging of non alcoholic beer and the regular thing is pretty much indistinguishable. From a social responsibility point of view that could be seen as encouraging brand recognition in a minor (think branded candy cigarettes). Secondly that similar packaging makes it hard to track who is drinking what at a table. A bottle of Becks Blue and regular Becks could easily be swapped between parent and child at a table without staff noticing. That potentially leaves an individual open to legal trouble. At weddings and the like it wasn't uncommon for an irate dad to kick off because his son had been refused service for a non alcoholic beer.
For most shops and bars it is company policy to treat beer and it's non alcoholic cousin as one and the same. Whilst legally someone under 18 can buy NA beer, the big supermarkets would all refuse service and the challenge 25 would activate on self service tills. Likewise if the barriers on the alcohol aisle are up pre 10am the NA beer will be within that boundary. Whether they would sell you it if you took it to the till is another matter, I'd suspect not as the barcode will belong to the licensed group and much like the challenge 25 activating for NA beer so it will flag up when being scanned 'out of hours'.
It comes back to the same issue as I encountered in bars. The easiest way to avoid encouraging people to attempt to buy alcohol outwith licensed hours is to treat alcohol substitutes as alcohol. I'm not talking about orange juice that has fermented slightly in the carton or whatever but rather items that are packaged to resemble and marketed as comparable alternatives to alcohol.
It sounds like the shop in question suffered from poor training, poor communication and confused or perhaps non existent policy but you would encounter the same answer in many shops and pretty much all the major supermarket groups. I think it's entirely possible the supervisor just didn't know the answer and was uncomfortable with the situation and looked for an easy out. Not an ideal way to deal with it but those selling licensed products are always wary of being caught out because the responsibility is on the person as well as the company.