I think the question is a bit too detailed. A short version is this: what do people do when they discover an error in other people's papers? Obviously, like the question explains, there is no universal rule - this all depends on the type of an error, relative importance of the results in the paper, relationship between a person who made an error (let's call her/him X) and who discovered it (Y), etc. Let me simply list some relatively standard options.
1) Y tells the error to X. X finds a way to fix it, publishes an "erratum" in the journal, on the arXiv and/or on his/her own webpage. Gives profuse thanks to Y (but only if Y is gives a permission to do so). Occasionally this a joint (X,Y) paper. Either way, this is the most desirable outcome.
1)' Even if the result is false in full generality, X should still publish an "erratum" saying "such-and-such weaker version survives", or even "every hope to prove such-and-such is lost forever"...
2) Y wants to remain anonymous, or X can't be bothered. Then Y writes a letter to editor in chief of the journal which published X's paper. It is their responsibility as much as X's. Let the editor(s) deal with the mess. This is the easiest way out (for Y).
2)' A slightly better way to remain anonymous is for Y (by agreement with the editors) publish a short erratum under an assumed name. I have seen this happen, but in a long run this does not work - eventually people find out who was the author (and in a couple of cases I know, MathSciNet rather counter productively links the pen name to Y). On the other hand, if you really want to remain anonymous, e.g. use an assumed name linked to a fake email account, your erratum submission will not be taken seriously (journals get quite a few crackpot submissions).
3) Y is heavily involved in the field and is writing an article/book (B) on the subject. Y doesn't know how to fix the error. Then sometimes it is a good idea to include this piece of math in the final remarks or an appendix. Y might want to be nice and inform X first, before making the error public. This is a good solid option which allows others to say "error in A was pointed out in B".
4) The error is fundamental, kills paper A, but Y knows how to fix it. Y should publish a new paper explaining the error in full, right in the introduction or the first section. Y should write the paper in such a way as if assuming that X will be refereeing the paper... On rare occasions, it can happen that later Z publishes a paper acknowledging an error in Y's paper, and claiming to have "finally" found "a definite proof", etc. Sometimes an unavoidable chaos ensues, but the good faith decision by Y to publish was still a good one.
5) Y can prove (by different means) a result which follows easily (or even a special case) of that by X. Y should still write a paper. Lots of delicacy is required in trying to explain the whole story. This is the hardest thing to do. Consult a senior expert before making the paper available.
6) In extreme cases, Y can just post a note on the arXiv (this happens occasionally, see the meta discussion), but let me strongly discourage this practice. It should only be used when no other recourse is available. When this kind of thing happens, the allegedly erroneous paper A is refereed, but the erratum is not, so the ousiders no longer know what to think. This can undermine the credibility of the field and turn people away from the working on the problem.
UPDATE: After reading what other answers, I realized that I am answering a slightly different question. This is only meant to catalog the possibilities, not to endorse them or explain "how to get there". The latter is often really delicate and difficult, so don't try it if you are not sure! Although some of these outcomes are preferable to others, this is also on case-by-case. Finally, the order is somewhat arbitrary.