A blockchain won’t solve the problem of creating a unique identifier for each banana and ensuring it was correctly scanned.
Also this isn’t a good example fundamentally because the banana is not immutable as in anyone can swap the barcode from one banana with another or it can fall off.
Blockchains really only work when everything is immutable.