Is bad tasting food more likely to cause harm?
tl;dr; If someone likes a food item, then even if it taste not so great to you, it will probably not harm you. If a food item taste awful to everybody (in particular bitter), then it would probably be best to avoid it.

Taste perception per se is not subjective, you either can detect or not a defined compound at a defined concentration. Food preference however is of course much more subjective.

The most established theory in the field is that we evolved both bitterness and sourness as a warning signal for poisonous compounds and inedible food. Bitterness is often the most referenced as most poisonous substances taste bitter to humans (e.g. strychnine, nicotine, ...) and are detected at very low concentrations (in the nM to $\mu$M range) (Meyerhof W, 2005). In comparison, the threshold for sweet taste perception is well above > 100mM (Park DC, 2015), or put otherwise, humans are at least 1000x more sensitive to bitterness compared to sweetness. As a result, we evolved to detect small quantities of bitter compounds and to dislike food items that are bitter as they could be poisonous.

Now for your question, you are probably misusing the word taste when you meant flavor, which is a combination of both taste and aroma (i.e. taste perception and olfaction combined, for example the "taste" of a banana). Food preference varies from people to people based on both genetic, physiological and more importantly environmental factors, in particular food habits. Typical examples are spiciness and saltiness where you can slowly adapt to tolerate higher and higher concentrations, meaning that your own food preferences can shift over your lifetime. Another illustration is the common shift in food preferences between childhood and adulthood. In other words, food preference is not an excellent predictor of a harmful food item.