To be fair, Mind Meld
actually explains that. The crew is on leave, awaiting their final orders (they're wondering if the ship will be repaired or scrapped) when she's placed on special diplomatic duty, reporting to Ambassador Sarek, for the duration of the novel. I think most of the post-TUC
novels explain why the ship in still in service, which means you get this hodgepodge of decommissionings and recommisionings.