If scanning the barcode is the critical step, why do it with an ordinary barcode scanner? Just make a conveyor belt that has multiple cameras. One of them will definitely catch one of the barcodes. I've done barcode scanning with ZXing lib myself on a phone, it's super easy even with one camera.
Perhaps set up the bags in a clever way so everything other than eggs falls into a new bag.
Also, it can't be long before you just scan stuff using an app as you're taking it off the shelf, connected to a payment method so you don't even have to pull out your wallet.
In Sweden* (and surely other places) you borrow a portable barcode scanner when you enter the store and scan your own products. At the end the cashiers take the scanner and do something and you're done.
I think they do random "bag checks" as well every now and then. And you might need to have the stores credit/debit card (but I am not sure because I never used this system myself).
I know of one chain here in Norway that does this, but only in a few of their larger stores. I believe you have to set up a card with them that is connected to your bank account. They have regular lines as well for the folks that don't do this.
I somewhat assume that when this becomes cheap enough, some version of it will be in all the places, probably in conjunction with something that weighs the cart or basket to see if it matches up to what you have scanned.
That seems to be a limitation of the barcodes themselves. Why don't they have three additional random-ish digits? Then the two-item/double-scan confusion would have a 1/1000 chance.
Perhaps set up the bags in a clever way so everything other than eggs falls into a new bag.
Also, it can't be long before you just scan stuff using an app as you're taking it off the shelf, connected to a payment method so you don't even have to pull out your wallet.