The wizard with wild pants and matching hat was a great salesman, and he hustled Jack into traded his beautiful cow (it is a stunning cow in this illustration) for some psychedelic beans. I agree it looks like a very bad deal. But in the end Jack got an adventure out of the deal. I think he eventually got his “beans” worth. Or maybe not?
Elephant

(1) he met a stranger on the road (made worse because he was alone on an errand for his mother);
(2) The stranger looked strange (yes, the tall pointy hat, the unisex pants, the yellow and black color theme! etc.)
(3) The stranger struck up a conversation with him about magic beans no less.
(4) He missed the cow’s cues – note the cow has the survival skills to turn his back to the stranger and ignore him.

Jack needs to grow up – sell his cow for cash, get out of that baby outfit and pay attention!