Spock said that the gravity systems were failing, that could mean they were going haywire, it didn't help that the Enterprise was caught in the gravity field of Earth.
At 300,000km from Earth, the gravitation field from the Earth is effectively 0. So, they should never have been "caught" in the gravity field of Earth. And even if they were, it would have taken quite a long time to fall (in fact, they probably should have crashed into the moon instead). Enough time for any given Federation starship, or a fleet of shuttles, to rescue them. Hence another majorly egregious BAD SCIENCE moment.