French drug giant Sanofi SA is betting that a biotech partnership named after a Star Trek premise will help it crack one of the biggest mysteries in pharmaceutical research: molecules that drive diseases, including some cancers, that have been considered “undruggable” because of their shape.

Four-and-a-half years in, Sanofi now believes its partnership, Warp Drive Bio, is close to getting its first new drug candidate. But the path has been painful. The venture has gone through three CEOs, two organizational structures, dizzying...