So... This is probably an idea worthy of a very long post, and I may flesh it out in the future. But for now, i want to make just this one point.

That "difficult" developer that you never seemed to incorporate into your team.

That developer that was always pointing out areas to improve and make better code.

That developer that didn't mesh well with "others on the team"...

Don't congratulate yourself on their departure. Or worse, on choosing to ask them to leave. Not right away!

Wait... Watch where they land. Look at what they accomplish at that new place, with that new team.

If they thrive and making amazing things... you LOST. You failed to retain a valuable and effective contributor. And you should deeply and seriously question your team, your culture and your organization.

Sure... maybe they just needed that new setting. Maybe it was just "a matter of fit." But no. Don't let yourself off that easily! Use that moment to really consider your culture and why this brilliant mind went elsewhere to make their excellent contribution.