There's also cheating : isn't coffee bean edibility observed from goats? essentially outsourced trial and error is a thing too.
Which is exactly what we do with lab mice.
Not only that. A lot of mushrooms can be eaten in small doses but will cause things like stomach upset well before death. I'd bet we as a species would quickly test mushrooms this way without dieing.
At some period in our evolution, it gave us pre-dispositions to certain tastes.
Like our fondness for sweet & salty is universal.