The author of the book about him believes that the stash of wild potato seeds he had gathered had gotten a certain type of mold that induced an alkaloid toxicity that prevented his digestive system from properly absorbing nutrients.
That's a little different than what I understood from the scene in the movie. He ate the wrong plant by confusing two similar ones but he didn't realize it until after he got sick. According to the plant book he had in the movie, the one he ate was highly toxic and causes starvation if you don't seek treatment.