For what it's worth, in the Navy command grade is based on responsibility; smaller defensive vessels such as destroyers and attack subs generally have a Lt. Cmdr (surprisingly, often called Lieutenant rather than Commander) or Commander, whereas larger vessels that carry out more responsibility such as SLBM Subs or CVN Carriers will have a Captain due to the high responsibility and larger volume in the chain of command (on a CVN Carrier, for example, the Captain my have command, but his job REALLY is to oversee all the department heads that actually run the ship-watch commander, air boss, CAG, etc.) I think TOS and TNG tried to touch on that with the fact that they were given flagship status, meaning they had much responsibility within the fleet, but that is just my guess.
Starfleet isn't the Navy, so it's just MHO.
Also, IMHO, I have a hard time believing Kirk would demote to the rank of Captain just to advance up to Admiral again, and then again wish to be Captain again. It was clear that Kirk regretted his promotion, so I have a hard time seeing him doing it twice. More than likely the events of TMP were a classic attempt at military lore that if a person of different grade were to take a posting outside their grade, they would take on a temporary grade change for a special event or mission in order to still be within the confines of military doctrine, in this case, Kirk saw an opportunity to again take command of a ship, even temporarily, given the grave threat to earth. In reality, such things rarely happen. A person would either keep their grade and simply change their rank for the mission (a common misconception that officers change both rank and grade), or more than likely it would be inappropriate for that person to take over direct command, but would more use their authority to influence that command (more like the TNG episode the Pegasus).
Again just my opinion.