The toxic person was hired by the CEO and predates his manager.
The toxic person was likely valuable early in the company's history (he's great at throwing together prototype-quality code), and that reputation makes him hard to fire.
when their manager is an absent owner, or distracted CTO, or something like that, a lot can happen and be explained away before it's seen as a problem.