All the promise built up in Episode Five comes crashing down, unfortunately, in Episode Six, as the house of cards that has miraculously been kept intact up until now is destroyed. Most of this episode features endless, repetitive chases throughout the many corridors and storerooms of the TARDIS (which all, it seems, bear uncanny resemblances to corridors and storerooms of a disused mental hospital). The jarring difference between the scenes on videotape in the console room and those that are shot on film in the abandoned hospital is too much to be believable, despite the omnipresent hum of the TARDIS interior.
And then there's the exit from the series by Leela. Yes, it's quite out of character and terrible, especially given the fact that Leela and Andred had barely looked at each other since Episode One. However, the writers were hamstrung with how to write the character of Leela out. It's been suggested often that it would have seemed more appropriate for Leela to join the outsiders and live in the wilds of Outer Gallifrey. This would have gone completely against the character arc set up for Leela during her time in the series. Throughout Leela's run, and especially during Season 14 and early in Season 15, the Doctor/Leela relationship was very akin to My Fair Lady, with The Doctor teaching Leela to rise above her savage upbringing and embrace science and knowledge. To have Leela regress, so to speak, and retreat from all that The Doctor has taught her would have shown The Doctor's efforts to be worthless.
To kill Leela off would have been equally injurious to the series, and The Doctor specifically, because, at the time, the series just wasn't set up to kill it's main characters. Doctor Who in the Graham Williams was an era of fantasy and adventure, not the death and destruction of the Hinchcliffe era (and even in the darkest moments of the Hinchcliffe/Robert Holmes era, killing off a companion would be the furthest thing from their minds).
Option 3, that of marrying Leela off, was just as bad, but, as you can see, the writers were out of options. They could have remedied matters slightly if they would have written even just one scene between Leela and Andred, but this never happened, and we're only given a brief hand holding scene at the end to give us the impression that the two had fallen for each other. Leaving K-9 behind also seemed out of place, but it gave the production team the chance to completely rework the K-9 prop, but it also gave Tom Baker another chance to stare straight into the camera at the end and flash his famous grin.
The Invasion of Time, despite it's faults, is still an enjoyable romp, and is the closest thing we get to the destruction of Gallifrey until the events of the Time War.