Like at the end of the day it’s just humans developing a system to make sense of nature
The core of the matter is that we have multiple, mutually incompatible schemes sharing in part the same terminology. Biology is not cooking, both fields care about vastly different things thus the categorisation scheme is different, that's the end of it. Culinarily, tomatoes have too much umami to be fruit. Botanically peppermint is an aromatic, I recommend you not put any into your soffritto.
EDIT:
Tomato is also dominated by oxalic acid, not malic, citric, (typical fruit acids) or acetic (fermented/overripe). Oxalic acid is in parsley, chives, spinach, beans, lettuce, that kind of stuff. "It's sour" isn't sufficient to describe a taste profile, our tongues may not tell them apart but our noses definitely do.
I think it should be possible to break the culinary categorisation down to chemistry. That doesn't tell you anything about the "why" but it's definitely not random and definitely not all in our heads.
I haven't but that sounds like a pie not a cake. A meal, not a dessert.