Ancient Egyptians did cultivate various plants that we now identify as beans around the time the pyramids were constructed.
It is true that Herodotus made a notable but dubious claim that beans were not cultivated in Egypt:
beans[...] the Egyptians do not at all sow in their land, and those which they grow they neither eat raw nor boil for food; nay the priests do not endure even to look upon them, thinking this to be an unclean kind of pulse.
I added emphasis to the term kind because it's likely he referred to a specific and unidentified type of bean, rather than beans in their entirety. Additionally, Herodotus' reliability on matters concerning Egypt is questionable. One article concludes that he likely never visited Egypt and made numerous factual errors. And finally we should point out that he was writing in the present tense long after the pyramids were built.
Meanwhile the footnote "3" in the quoted passage points to the first chapter of Book XVII of Geography by Strabo, written approximately four centuries after Herodotus. It directly states that Egyptians grew edible beans of some kind, but I don't see any explicit statements about petrified remains of beans or the builders of the Pyramids. This interpretation might be attributed to the author of the Nature article.
Both sources were written long after the pyramids' construction but before modern Egyptology. So regarding the builders' consumption of beans, neither source holds value.
What concrete evidence exists about the cultivation and consumption of beans in Old Kingdom Egypt? While evidence is limited, it contradicts Herodotus. A 2020 book chapter on Bronze Age Egyptian agriculture states that broad beans and peas were both recently discovered in abundance at a royal domain at Sheikh Said (2575 BCE). It also asserts that pulses like lentils, peas, chickpeas, and fava beans likely served as crucial and widely available protein sources for the population, although official texts and iconography do not tell us this directly.
So broad beans (also known as fava beans) and peas were definitely grown and consumed in Egypt around the time the pyramids were built. It's possible that chickpeas came to Egypt only later, but overall, the current evidence absolutely refutes Herodotus' claim if it is understood as understand "beans" today.