Seems mostly pointless to me, whether friends or colleagues. And, in some circumstances, possibly harmful to them, to you, and to your relationship with them.
We all make occasional mistakes.
In fact, the only factor that would make me want to tell said colleagues is this: is this a mistake that I know they wouldn't usually do / a situation that I know they would know how to handle?
If the answer is yes, there's no need to bug them as there's probably no educational value for them, so I don't see a duty to inform them. If you run across them one day or plan to have drinks on their last day and you have a good rapport with them as peers and fellow professionals, sure, you could mention it, more to feed some friendly or harmless banter than anything else.
If the answer is no, then there might be an obligation (wouldn't call it a "professional" one, though) to reach out and help them understand their error.
Keep it Civil
Most people don't like criticism about their job in general, developers/programmers even less so, and departing programmers would probably have even a lower tolerance. Why take the risk of annoying them, and giving them the impression that they leave on a bad note?
Sure, if they were bad employees throughout, this doesn't apply, but if they were otherwise sufficiently skilled fellow progammers, I don't see why I would go out of my way to emphasize their mistakes, except if I can be sure we can both laugh it off. Again, assuming they wouldn't learn much from it and just be mortified that they left that behind.
From a different approach angle, if they have left the company, it really depends on your contract and on your company's security policies. You may not be allowed to take about the code (or other things, for that matter) to former colleagues.
Finally, I think that the only situations where I reached out to former colleague to discuss a codebase they left behind were:
- to request a confirmation on something shady while researching a particular area of the code,
- to congratulate them on some bit of code I found particularly masterful and that would have made my life worse if it weren't there,
- to share the good news of a successful launch with them if they left before it happened (or similar big announcements relating to a product they used to work on).
Learn From Their Mistakes
What you can surely do is point out the error to the rest of the team, to ensure it doesn't happen again with the remaining members. No need to point to the actual error in SCM or to the author, it's not a blame game.
It's outside the scope of the question, but I'd still point out that you should make sure to fix the error, document its origins, impacts, and resolutions, and implement a test for it to not show up again, if possible.