Hey Keyser, something like this happened to me a couple of times
long time ago at Chennai airport, i picked up some cookies post security and i was asked to produce the receipt (luckily the guy at the cookie counter had told me to keep it). more recently, at BOM, i picked up some stuff from Chroma and again i had to show the receipt at the gate
of course there is a difference in that the cookies and the Chroma stuff were in a box and i understand the requirement to either show a receipt or have it scanned
BUT a sandwich and a juice? thats just ridiculous. i have carried water i have purchased thru the del t3 vending machines and that was without a receipt - if you can take in stuff purchased from the snack and drink vending machines in Delhi which is without a receipt, i dont understand the difference (other than the fact that the vending machine doesnt provide a bag) - why not a sandwich and juice. if u had simply put the "snack" bag into your carry on before reaching the gate, the security guy wld have been none the wiser. this seems simply asinine to me and i have to agree with rathin's post earlier on security