The important thing to distinguish here is the difference between natural selection and artificial selection. In nature, the cannabis plants likely don't care about potency unless it provides them with better fitness to survive and reproduce. So being a Hermie is great in a natural selection sense if there are no males around to pollinate the females, however if there were only hermies then the lack of genetic diversity would likely kill the species eventually. For our purposes, we want to breed for specific traits that may or may not have anything to do with gaining a fitness advantage for the species. This is artificial selection, so we can produce plants with more of the stuff we want (IE higher THC, CBD, terpines, yield, etc). So yes, the plants ability to Hermie if it needs to in order to further the species can an evolutionary advantage but for most people that are growing cannabis, it is better to be bred out or at least avoided when breeding