....I do not think that it is any way a desirable suggestion for TOS as a work as whole that Spock went from being Science Officer, to a promotion to only XO, then demoted to Science Officer, and then promoted back to both...
Here's a quick question: "Which side was Jefferson Davis on during the US Civil War?"
Think about that for a while because the answer is connected to a historical example of a quirk of military administration.
I can't believe that nobody replied to my post.
Jefferson Davis (1808-1809) was the Rebel president in 1861 to 1865.
There is an anecdote from the Civil War about a man who waited in the office of General Jefferson Columbus Davis (1828-1879) and eventually was let in to see him. When asked his business the man said: "I just want to shake your hand. You must be the greatest man in the world, to be the Rebel president and a Union general at the same time!".

General Jefferson C. Davis was famous for shooting General William Nelson during the Civil War. Unfortunately, General Nelson was a Union general and Davis's superior officer. There was also an incident when Davis broke down a bridge behind his unit, stranding a following crowd of escaped slaves on the far side of the river at the mercy of the Rebels. Davis's military skills led to him commanding a division and then the XIV corps, but he was never promoted beyond the rank of brigadier general of United States Volunteers.
In the eyes of his superiors Davis should have been thankful enough that he wasn't hanged without complaining that he was never promoted. And I guess that General Davis was always annoyed to hear people singing "We''ll hang Jeff Davis from a sour apple tree".
After the civil war the United States Volunteers were disbanded and General Davis's commission as a brigadier general of United States Volunteers was decommissioned. Hundreds of former generals and other high ranking officers in the United States Volunteers now scrambled to compete for high ranks in the regular army, the United States Army. Jefferson C. Davis was lucky enough to be commissioned as the colonel of the new 23rd United States Infantry Regiment in 1866. Davis also gained the brevet commission, largely honorary, of brigadier general in the United States Army.
But the army top brass wouldn't let Davis command his regiment stationed in the relative comfort of various western forts. Instead they almost literally exiled the murderer to Siberia, sending him to Alaska, recently purchased from Russia. Davis established a fort at Sitka, Alaska, October 29, 1867.
Alaska was a military territorial district, part of the Department of the Columbia, which was part of the Division of the Pacific. Alaska became a separate department, the Department of Alaska, under the Division of the Pacific on March 18, 1868, but was reduced to a district under the Department of the Columbia again on July 1, 1870.
So Jefferson C. Davis was a subordinate of George Crook, who commanded the Department of the Columbia, from November 23, 1867 until Alaska became a separate department on March 18, 1868, and again from July 1, 1870 until August 8, 1870, when Brigadier General Edward Canby replaced Crook as commander of the Department of the Columbia.
Even though George Crook had the brevet (honorary) ranks of colonel, brigadier general, and major general, in the United States Army at the time, his substantive rank was only lieutenant colonel. So Jefferson C. Davis was subordinated for several months to a lower ranking officer. Which regiment was George Crook the lieutenant colonel of? The very same 23rd United States Infantry that Jefferson C. Davis was the colonel of. So Jefferson C. Davis found himself the subordinate in territorial command to someone who was both his junior in substantive rank and also his subordinate in their regiment.
And I hope that this story goes to show that sometimes some very strange command arrangements are made.