It is called dysgeusia and refers to the perception of unpleasant, metallic, or bitter tastes in food.
It can help to avoid bad flavours.
Very often, the bad taste of food occurs when it does not meet the expectations of the dish; if you prepare dishes that you have never tried before, you minimise the effect of expectation and can better tolerate strange tastes. It is an opportunity to get to know new food cultures and to choose spicy preparations that are appealing, but at the same time easy to prepare.
Avoid eating your favorite foods as the body tends to associate feeling unwell with the foods you have just eaten and may develop an aversion to them.