The prohibition on benefiting from a melakha done on Shabbat only applies when the action is clearly prohibited. However, if the action is the subject of dispute, even if general practice follows the stricter opinion, one may benefit be-di’avad from the melakha. This is because the entire foundation of the prohibition on benefiting from work done on Shabbat is rabbinic, and since we are lenient whenever there is a uncertainty pertaining to a rabbinic rule, we follow the lenient position in the dispute over whether this act is prohibited (Pri Megadim; MB 318:2).
For example, if one cooks raw meat, it is clear that he has transgressed, and the food may not be eaten on Shabbat. However, if one took partially-cooked food that is edible under pressing circumstances and placed it on a fire until it cooked fully, it may be eaten on Shabbat. Even though the halakha follows the opinion that doing so is prohibited by Torah law (SA 318:4), since there is an opinion that if the food was already edible, cooking it further is not prohibited (above, ch. 10 n. 1), if one transgressed and cooked such food on Shabbat, it may be eaten.
Similarly, if one took cold soup that had been cooked before Shabbat and heated it on a plata on Shabbat, although many maintain that he has violated Torah law (SA 318:4), it may be eaten, because Rambam allows doing this (above, 10:5-6).
Let us say one took a tea bag, put it in a glass, and poured boiling water over it directly from an urn, which is a kli rishon. Doing so is prohibited because, according to most poskim, pouring boiling water from a kli rishon cooks the outer layer of the food (above, 10:7-8). Nevertheless, be-di’avad one may drink the tea, because some maintain that one does not violate Bishul by pouring hot water over a tea bag, only by placing the tea bag directly into a kli rishon (Rashbam, Ramban, Rashba).