If the baker knew that one of the cakes was going to cause serious illness, and willingly sold a cake without determining that it was not the cake with the problem, then he should go to jail.
Note that the keys here are serious illness and knowledge. If the baker didn't know that one of the cakes was bad, then it's a different situation. If it just might not taste as good, then it's a different situation. It's the combination of serious illness and baker knowledge that brings about the problem.
Note that there were multiple "outs".
Option 1: Baker informs the customer of the situation, customer knowingly accepts the risk or rejects it. If the customer rejects it, then it's a bit of lost business, may harm his further business as the customer informs others... but not as badly as if the customer falls seriously ill.
Option 2: Baker starts performing checks of the cakes. Knowing only one is affected, the baker starts "destroying" cakes, in search of the bad one (this assumes that there is a way to identify the cake, but the check destroys the cake). With a 1% chance of each cake being the bad one, the baker has a reasonable chance of only destroying half of his inventory or less. But the Baker saves face and probably protects future business.
I see that some have observed that this is an analogy to sex and condoms. There are a few key differences.
1. The man cannot know that he has an imperfect condom - that is, it's not that he knows that there's one weak condom in his batch of 100, only that there's a 1% chance that the condom he has might break. Assuming the woman (or gay partner) is also aware of this, it fails to be an analogy both in terms of the man's knowledge and the other person's knowledge.
2. There is no transaction taking place - that is, the man is not making a financial gain or otherwise gaining anything that is being traded for something knowingly possibly-defective.
3. The man did not manufacture the condom as the baker manufactured the cake (presumably).
This alters the situation enough that the morality and the responsibility should be different. In my view, if both sexual partners know that the condom could break, and both choose to go ahead with the sexual activity, then the responsibility should be exactly the same as if both choose to have sexual activity without a condom.
Note that an exact situation mirroring the Baker analogy would be medicinal drugs... if the laws didn't state that warnings must be put on them indicating possible side-effects, etc, but it was known that serious illness occurs in 1% of patients who use the drug, then selling the drug without such a warning would be a breach of responsibility akin to the Baker possibly selling an infected cake. This is why laws are in place requiring those warnings.