Read: A dramatic error in American spaceflight

The launch was an important test in NASA’s plan to launch its own astronauts from U.S. soil for the first time since the space shuttles stopped flying in 2011. While two American companies, Boeing and SpaceX, are developing new spacecraft, NASA astronauts have been hitching some very expensive rides alongside cosmonauts on Russia’s Soyuz system. Before these two companies can fly people, though, they must prove their chops during an uncrewed journey to the ISS. SpaceX flew a similar—and successful—mission last spring. (It suffered a significant setback a month later when its capsule exploded during testing on the ground, but it has since rebounded and a new one could lift off from Cape Canaveral—with astronauts—later this year.)

Timing is everything, especially in spaceflight, and that’s where Boeing’s Starliner first had trouble. Thanks to a software glitch, Starliner incorrectly set its internal clock hours before it launched, which meant that after it separated from the rocket and reached space, the capsule missed the moment it needed to fire some thrusters and push itself into the right orbit. In a cruel twist, mission control lost contact with Starliner just then because, it seems, of interference from radio noise on Earth, possibly from cellphone towers. By the time engineers could command Starliner again, the capsule, disoriented and idling, had used up too much fuel to finish its climb toward the ISS.

With no choice but to return Starliner home, Boeing engineers started combing through the software and found another issue. Before Starliner begins its final descent to Earth, it must shed a service module that helped nudge it toward the atmosphere. But the way the software sequence was set up, the thrusters on this module wouldn’t have fired correctly. A rocky separation could have destabilized Starliner, causing it to tumble. The two spacecraft could’ve even bumped into each other, in which case the impact could have damaged the heat shield. Starliner needs that shield to survive the fiery drop of reentry, with astronauts on board or not.

“It’s hard to say where the service module would have bumped, but nothing good can come from those two spacecraft bumping,” Jim Chilton, the senior vice president of Boeing’s space and launch division, told me.

Boeing engineers rewrote the software and sent the new version to Starliner barely three hours before the capsule touched down in New Mexico. If they hadn’t intervened, NASA says, Starliner could have been lost.

It is impossible to say what would have happened during this mission if people had been on board. Boeing officials have said that astronauts faced with a similar clock problem could have taken control of Starliner and guided it to the proper orbit. It’s less clear what they could have done to deal with the potential threat of a crash.