You may have seen videos online of cats appearing to be spooked by cucumbers, but it’s not cucumbers in particular that they’re scared of. Cats are naturally very aware of their surroundings, as in the wild they would have to be on the lookout for predators, so if anything suddenly appears behind them they will likely find it threatening.
It could be that cucumbers invoke such a strong reaction because cats initially mistake them for snakes. Regardless, it’s best to avoid spooking your cat as it causes them stress