I've just learned that about five years ago, I made a false claim in the midst of a longer discussion of an example. I didn't include my putative proof of this claim because I was under pressure from a coauthor to not to go on too long about trivialities, but it's easy to check by computer that the claim is false, and I don't know why I didn't do so then.
Anyway, the paper was published three years ago and apparently has finally found an audience, who has noticed this claim is false. The false claim fortunately doesn't play a role in what's included in the rest of the paper. (It does play a role in what's excluded—I would probably have proven the result my correspondent wrote to tell me about if I hadn't found this fake counterexample—but this doesn't require correction, just critical self-reflection and an evaluation of my suitability for the profession.)
Although it has no impact on the other results, I don't like having an error out there uncorrected in published work. When I've written others to gently inform them of errors I've found in their papers, and they've made no motions to address them in any way, I have been very unimpressed. So I don't want my audience's paper to come out with the remark "Note that our central theorem contradicts Example x.yz in the very bad paper by jdc et al., where the following absurd thing is claimed" embedded somewhere within, without my at least having been seen to have acknowledged and attempted to correct the error.
But it may also be that all the people who will ever have any interest in this (carelessly, as it transpires) tossed-off remark already know now, in which case it may be more about pride than principle that I want to announce this error, even self-serving, in its way. In that case, it seems possible that the journal will tell me, "We don't really bother with this level of thing," and all this agonizing is pointless. I don't know; I've never tried to write an erratum before.
When is it appropriate to issue an erratum?