Why do you say that TMP was set just 18 months/2years after the end of the original show?
And don't go to the Star Trek Chronology and look it up there. That is the official chronlogy used by writers since it was published. It is not the accurate chronology unless the Okudas did an absolutely perfect job as historians working out the chronology from evidence in the episodes and movies.
According to the dialog written in the script for TMP, TMP must be at least 18 months since the end of the 5 year mission, since the Enterprise has been being rebuilt for that long.
According to dialog, TMP is at least 2.5 years since the end of the 5-year-mission, since Kirk has been chief of starfleet operations for that long.
According to dialog, it is at least 2.5 years since the end of the 5-year-mission, since Kirk has not "logged a single star hour" for that long. I guess that means that Kirk has not been the commander of an interstellar space vehicle, or maybe a duty officer on an intersteallar space vehicle, for 2.5 years. It might possibly mean that Kirk has not traveled as a passenger in any interstellar space vehicle for 2.5 years.
And presumably TMP should probably be before WOK and so presumably less than 15 years after
"Space Seed".
Thus it would be possible for Kirk to be a commodore in command of a starbase for several years after the end of the five year mission, before returning to Earth 2.5 years before TMP.