Bread is only permitted to be left on an uncovered flame if both sides of the bread have crisped to the point that if one were to break open the bread there would not be any strings of dough stretching out of it. It is not allowed to be placed on a flame right before Shabbos, unlike raw meat which is allowed. This applies even if one only plans to eat the bread after Shabbos.
Filled pastries: Dough which has a filling of meat, fish or cheese besides for being crisped on both sides, also must have their filling be half cooked in order to leave them on an uncovered flame.
If one transgressed: If one transgressed and left the bread in the oven, then as long as one side of the bread has crisped before Shabbos it may be eaten. However, if neither side of the bread has crisped, then if this was done advertently [with prior knowledge of the transgression] it is forbidden to be eaten until after enough time has passed after Shabbos to bake it. However, if it was done inadvertently [without prior knowledge of the prohibition] then if one has no other bread to eat on Shabbos, it may be eaten.
Removing the bread from the oven on Shabbos: If one forgot to remove baked Challah from the oven before Shabbos, then he may only do so on Shabbos if he plans to eat from the Challah’s on Shabbos. In all cases that it is allowed to remove bread from an oven, even by today’s ovens, it is Lechatchila not to be removed with its designated tool. Rather one should stick a knife and the like [into the loaf] or remove it with a stick.
 See Admur 254:6-12
 Admur 254:6 “It is forbidden to place any dough close to Shabbos into any of the forbidden ovens mentioned in chapter 1 unless there is enough time left before Shabbos to crisp the entire surface of the dough including the bottom area that is resting on the pan or floor of the oven. The reason for why it suffices if the dough crisps before Shabbos is because then we are not worried that on one may come to stoke [the coals] as [if one were to do so] it will ruin the bread. All bread which has been baked to the point that if one were to break it then there would not be strings of dough drawing out from it, then for certain its outside is crisp enough as required.”
Other opinions: There are opinions which say that even if only one side of the bread gets crisp before Shabbos, this suffices to be allowed to leave the bread in the oven over Shabbos. [2nd opinion in Admur ibid] One may rely on this latter opinion Bedieved, that if one transgressed and placed bread in a forbidden oven close to Shabbos and only one of the sides had become crisp, it may be eaten on Shabbos. [Admur ibid]
 Admur ibid “Even if one placed the dough really close to Shabbos, in which case if this were raw meat that was placed in a pot then it would be permitted to do so even initially being that it is completely raw before Shabbos, nevertheless by bread and the like, such as cakes and types of dough that are baked in a pan, it does not help at all and thus remains prohibited.”
The reason: This is because dough does not need a long time to bake, as opposed to meat which requires a long time to cook, and thus the bread can be ready to be eaten for the [Friday] night meal, and there is thus worry that one may come to stoke the coals in order to complete its baking in time for the Friday night meal. [Admur ibid]
 Admur ibid “Even when one does not have intention to eat from the bread on Shabbos, it is forbidden to place it inside forbidden ovens so close to Shabbos that there is not enough time for the outside part of the bread to become crispy before Shabbos.”
The reason: The reason for this is because we are worried that one may change his mind afterwards and decide to eat it on Shabbos, and thus since he will now have intention to eat it, he may come to forget and stoke the coals to [speed up the] finishing [of] the baking. [Admur ibid]
 Admur 254:6 “Dough which has a filling of meat, fish or cheese needs, in order to be allowed to be left on the fire from before Shabbos, to be crisp on its top and bottom, and it needs its stuffing to be cooked to the point of Ben Drusaiy before Shabbos begins.”
 Admur ibid “One may rely on this latter opinion Bedieved, that if one transgressed and placed bread in a forbidden oven close to Shabbos and only one of the sides had become crisp, it may be eaten on Shabbos.”
 Admur 254:7-8 “If it did not crisp at all, it is forbidden to be eaten by him and others until enough time has passed after Shabbos to be able to bake it. However, this prohibition to eat the bread on Shabbos only applies if one advertently, with prior knowledge of the prohibition placed the bread there. However, if this was done inadvertently, without prior knowledge of the prohibition, then it is permitted for him to remove from the oven enough bread for the three meals of Shabbos, if he does not have any other bread for Shabbos. [As well] he can tell other people which do not have bread for Shabbos ‘Come and take for yourselves enough bread for the 3 meals.”
The reason for the above leniency by bread: Why did [the Sagest] not fine [one who left bread on the oven] inadvertently as they did fine by one who left food [on the oven] inadvertently even when he has no other food? [The reason for this is] because there is not so much of an obligation to eat cooked foods on Shabbos, however without bread one cannot fulfill the Mitzvah [to eat] three meals on Shabbos. [Admur ibid]
One who has enough bread besides for the bread that was inadvertently left in the oven but does not have Lechem Mishnah: If one has a large piece of bread [leftover] big enough for all three meals, then it is forbidden for him to eat on Shabbos from the bread [in the oven] which was baked through a prohibition, [even if he wants to do so] in order to make a blessing on two whole loafs, as the main Mitzvah of eating three meals on Shabbos can be fulfilled without this bread. [Admur ibid] Meaning since without Lechem Mishnah one still fulfills the main Mitzvah of Seudas Shabbos, if he eats bread, therefore he is not allowed to partake in the bread left in the oven.
 Admur 254:9-10 “The removal of bread on Shabbos from the ovens that existed in the times of the Sages [which was made similar to a pot and the bread is baked sticking to the walls of the oven] is Rabbinically forbidden even if it was placed there from before Shabbos and was fully baked before Shabbos began. In our ovens today, that the bread sits on the floor of the oven the prohibition of removing the bread no longer applies, and thus it is permitted to remove on Shabbos all the bread, which was baked in a permissible way, even if one has other bread available. However, this allowance only applies when one has intention to eat from the bread that he is removing, even though he does not technically need it being that he has other bread available. However, if one does not intend to eat from it, then it is forbidden to remove it, even through doing so in an irregular way, as it is forbidden to prepare on Shabbos for the weekday.”
 See Admur 254:7 and 9