I believe a robo-picker would not mistake the clearly coded cucumber for zucchini, nor would the well-trained AI allow non-ideal produce into the sorting bins. No need to worry.
This is about moving these techniques further down the chain. A robot picker arm with a few cameras attached that can tell whether something is rotten is well within our grasp. (Awful pun intended!)