The Rabbanan prohibited eating certain foods cooked by non-Jews in order to limit social interaction which might lead to intermarriage between Jews and gentiles. This prohibition is known as bishul akum. These halachos are recorded in Yoreh Deah, siman 113. In seif hei, the Shulchan Aruch writes that food cooked by a non-Jew is only prohibited when the non-Jew had intention of cooking the food. However, if the gentile had no intention of cooking, the food, would be permitted.

There is a very relevant application of this halacha. A person, who lives in an apartment building, was roasting meat in his oven. Before the meat became edible (c.f. seif ches), the power went out in his building. An hour later, the electrician fixed the power to the building and the oven started working again. Because the electrician was unaware that his turning on the electricity would cook the meat, it would be permitted to partake of the meat.

However, if the circuit which controlled the oven tripped and a non-Jew reset it, the shailah is much more serious. For there the non-Jew did know that he was enabling an oven which had food inside to cook. And the meat would be forbidden.

However, if the person did not know the halacha, and had already called the electrician, in a situation of a significant loss there is room to be lenient. The Aruch Hashulchan (29) writes that this Halacha only applies when the Jew did not put the food down with the intention of cooking it. According to the Ra’avad (Shach, 7), any food cooked in the house of the Jew is permitted. In such a situation, a person would be able to rely on these shitos and enjoy the meat.

– Yosef Dovid Rothbart, Rabbinical Administrator for Halacha Institute of Toronto (H.I.T)