Can beans be overcooked? Coffee beans, for example, are incredibly roasted. Falafel is baked or fried garbanzo beans. Is it possible to overcook beans, or is this good for breaking down the sugars, phytic acid that cause flatulence, indigestion of legumes?
Beans can absolutely be overcooked.
Coffee beans aren't really beans--they're seeds from a fruit--but they are very temperature sensitive when roasted. There is a wide range of roasts, but dark roast in particular is essentially brought right to the edge and stopped before burning. For folks who like lighter or medium roasts, even dark roasts of coffee can be unpalatably burnt tasting.
As far as legumes and "real" beans go--absolutely. Beans can still be burnt (such as over-fried falafel, or grilled haricots verts), or overcooked until they just turn to mush. If you simmer bean soup long enough, the beans will just disintegrate and lose their shape.
Dried beans in particular are fairly forgiving--there's a pretty wide range where they are edible & enjoyable. The long cook time on dried beans means hitting the doneness between "not crunchy" and "not mushy" is fairly easy.
Fresh beans (haricots verts, green chick peas, fava beans, etc) are quite the opposite. Like other fresh vegetables, the cook time is relatively short and thus it is easy to turn them into a mash by overcooking for just a few minutes. Some people do like mushy vegetables--but many would consider mushy fresh vegetables (including fresh beans) to be a culinary sin.
I found this detailed article on the topic of Can You Overcook Beans? (Things to Know), below is a quote from it (I've also added additional highlighting to the important parts):
Can you overcook beans?
Well, the answer to this question is that it depends. Overcooked beans will have an undesirable texture, but they may not be harmful if eaten. Furthermore, most people will spit them out rather than swallow them and ingest overcooked food.
So, [overcooking] certainly can take away from the flavor and make beans taste bad. But, if you overcook your beans, don’t worry! Just add some seasoning (especially salt) to help mask that off-putting texture.