The standard phrase for tastes bad is 难吃. But plenty of stuff tastes bad without being edible. For instance toothpaste. I performed a google search for:
finding no exact and just one near match.
So, how to express tastes bad, when the subject is not edible?
Perhaps only for bitter pastes?