"Or he intentionally messed up the bar code"
I also don't play scratchers, but surely they also have numbers on them for identifying the specific ticket. The NY online game tickets I'm looking at have 3 sets of numbers on them in addition to the bar code. One set is a 5 digit code that identifies the retailer, and the others are 18 digits and 6 digits. There's also a set of printed numbers on the back that tell what roll of printer paper the ticket came from, and where on the roll it was printed.
Aside from general security measures, the lottery knows that tickets will get dirty or damaged, and they don't want to waste their time verifying modest winners. If a bar code doesn't scan properly when you buy something at a store the clerk can manually enter the numbers under the bar code, and I'd expect that's how it works for a lottery ticket if there's a problem scanning the bar code.
All those digits make it very unlikely to enter numbers that match a legitimate ticket unless you correctly enter the numbers from the legitimate ticket you're reading the numbers from. That means it's wildly unlikely that the clerk followed protocol and believed the tickets were winners based on a response from the lottery terminal.