I had a fail when making yogurt in an instant pot. Milk did not "take" as yogurt after a 12 hour incubation. It smelled fine. I was hoping because I refrigerated right away I could use to make bread or some other baked good that cook/bake at a high temp 350 or higher in an oven for a long period of time.
Is it ok to use milk that incubated for 12 hours but did not set for yogurt in baked goods?
From a conservative food safety perspective, the answer is no. The USDA suggests you discard any milk in your fridge after a 4 hour power outage -- surely your 12 hour incubation has more potential for bacterial growth. Baking is not a sufficient substitute for sterilization. Although the internal temperature of your baked good will probably reach boiling, it will not stay there long enough to guarantee all harmful bacteria are destroyed.
In yogurt making, you rely on cultured bacteria to acidify your milk. This acidity not only "sets" the yogurt, but protects it from the growth of further harmful bacteria. If your yogurt did not set, it is likely that the cultured bacteria is dead; perhaps you got a bad starter, or maybe you overheated it. In any case, there is not sufficient acid in your old milk to protect from harmful bacteria.
Some cooks regularly use slightly spoiled or soured milk, like Dan Barber in this interview. Pasturized milk goes bad in a fairly consistent way: according to this National Geographic article, first it goes through a souring processes with the growth of Streptococci and Lactobacilli. Only then do yeasts, molds, and Bacillus bacteria begin to grow, usually resulting in a strong smell of ammonia. The Streptococci and Lactobacilli are safe to consume (in fact, they are the same bacteria you tried to introduce to your yogurt), but the Bacillus can cause foodborne illness. This supports the idea that "slightly" spoiled milk could be relatively safe.
However, I would highly recommend you simply discard spoiled or possibly spoiled milk. It is a shame to waste milk, but hopefully once you perfect your yogurt making process this will be a rare occurrence. Ultimately, milk is pretty cheap and foodborne illness is pretty unpleasant. If you want to use a fermented milk product in your baking, just buy some: store-bought cultured buttermilk is safe, cheap, consistent, and delicious.
I think it would be safe to use in baking because as you noted you'd be heating it. Note that your oven might be on 350F when you're baking but the inside of the bread is probably somewhere around 200-220F when it's done. Still high enough to kill bacteria but not 350F.
I would make sure it has not spoiled, because that awful taste of spoiled milk might be enough to ruin whatever you're baking. Usually the smell test will tell you. It's a little hard to know what could have happened to it if it was in a warm environment for 12 hours, surely there was bacteria growth of some kind. You could taste a small amount, a few drops would not make you sick, and you'd immediately know if it was spoiled or not.
That said, I have many recipes that actually call for sour milk, traditionally they would use buttermilk, which is a lot different today than it was in the past, but it is literally sour i.e. higher in acidity and this reacts with the baking soda in the recipe to add leavening and texture to the bread. When I don't have any buttermilk (which is almost always) I achieve this by adding a splash of vinegar to the milk. This also tends to curdle it but that doesn't matter in baking recipes. So if your milk has not spoiled it might be perfect for many baking recipes.
In my opinion, this is not safe, it is possible that the milk has deteriorated, you can try to make a new yogurt to use again.