As in the title, I read it in the UK, maybe late eighties, I can't remember if paperback or hard cover, or if it was new, or one of the 'official' Trek novels.
Kirk is working in some low level role and, when occasionally recognised, is jeered at due to his past.
A planet with a race of intelligent beetle like humanoids was scoured by phasers and all killed, Kirk was held to blame, courts-martialled and drummed out of Starfleet (I think a computer glitch he should have been aware of).
He is now doing low level work at a spaceport (maybe a space station?) and something goes wrong on a passenger shuttle, using his skills he takes over and saves many - I think a few are still lost.
This brings him to the attention of a scientist girl (yay! Kirk still has it!) and they talk for a while, she studies obscure alien races, I think, and casually lets slip some important info.
The beetle people, due to odd weather conditions, have the ability to rapidly cocoon in a sturdy shelter and unfold stout wings to implement this, they can then hibernate for a long period.
Kirk somehow (I can't remember how but it's Kirk) gets a starship and gets to that world with a rescue squad. They find the residents are emerging from their cocoons to barren wastelands but Starfleet quickly helps.
A beetle girl approaches Kirk (what a guy!) and asks how to enlist in Starfleet, I think by this point he's already reinstated