Since I work for Sainsburys I thought I would try and answer the OP, even though the alcohol laws in Scotland are slightly different I believe.
They use this policy called "think 25" when people try to buy alcohol, basically if you don't look over 25 they will ask for ID from the buyer and whoever is with them. Obviously if you can't all prove your age, you can't buy it. It is taken pretty seriously, because if the person serving at the till is found to be selling drink to under age people they basically lose their job, and if unlucky get a few thousand pounds fine from the police. The store also potentially loses the licence to sell alcohol, so they are just better being safe than sorry, inconvenient as it is for the customer.
As for you going back 2-3 hours later by yourself and not getting sold, that's just unlucky in my opinion. Someone just must have recognised you and told a manager. Again its better safe than sorry from their point of view.
Parents not getting sold alcohol with children I haven't heard of, and is probably not true, unless it's blatantly obvious the alcohol is for someone under age. The person at the till just uses their judgement, and if in doubt won't sell it.
So basically yeah it sucks, but the policy is used for a good reason.