Outside law firms can be among the first casualties—or at least find themselves suddenly vulnerable—when corporate boards oust their CEOs for alleged misbehavior and then engage in mop-up operations.

And even if a firm ultimately keeps its client, there’s no denying the turbulence in the wake of such exits.