Except that both "Chief of Starfleet Operations" (or at least the Chief for the Sol System) are former starship commanders, and in charge of all Starfleet functions including the "command" function of starship deployments.
		
		
	 
Division changes occur fairly frequently in Starfleet. There's really no reason why one couldn't transfer to Command, Captain a starship, get promoted and transfer into a flag-level position in another division.
It might also be a symptom of Starfleet calling 
everything "Operations". The Chief of Starfleet Operations may not be the... Chief of the Starfleet Operations Division, instead being the the Chief... of the Operation... of Starfleet.
	
		
	
	
		
		
			IMO, Engineering isn't a single department but rather at least three different department depending on function. The Corps of Engineers and the Advanced Starship Design Bureau are responsible for large scale construction and starship design projects, Starfleet Tactical co-ordinates research and development, and Starfleet Engineering Operations acts as the department within Starfleet Operations that implements the results within Starfleet as a whole.
		
		
	 
That could be true, but I tend to see them more as subdivisions. I'm going to use some more generic terminology here just to highlight the differences.
There seems to be a Hierarchy of:
Operations (Division) - Flag
-> Operations (Department)
-> Engineering (Department)
--> Corps of Engineers
--> Advanced Starship Design Bureau
-> Security (Department)
Starfleet, by the 24th century for sure, is an absolutely gargantuan organization. Each of the "Color Divisions" so to speak has probably dozens if not hundreds of sub-divisions. In this case, I think there would be an overarching "Engineering Command" so to speak that would organize and coordinate the other various engineering subdepartments.
I would also maintain there is a huge amount of interdepartmental coordination. Like, the "Warp Technologies Development Group" I might put under Science, but they would definitely work with engineering all the time.
EDIT -
Random thought but I never liked the idea of Starfleet Intelligence being it's own entity/branch/division. Even though we tend to see people at least associated with Intelligence in red, it seems to make more sense for them to be under Operations. There is also a part of me that thinks each division might have it's own Intelligence arm, perhaps Starfleet Intelligence proper is under Command, Starfleet Security is obvi Operations, but even Science has... something? I'm inclined to say the Daystrom Institute may act in this role... while it's a civilian organization, it's ALSO tied to Starfleet, and I do think it could be possible that the Starfleet arm of Daystrom acts as the Science intelligence agency.