Didn't Worf make the rank of lieutenant commander while still security chief of the E-D?
I don't think you can make anything of the lack of non-command-colored flag officers, or security officers of the rank commander and captain.
For one, you're dealing with a ship whose CO is a Captain, and whose XO was a Commander (in both series...in fact, Spock was a lieutenant commander for the first season). I would be irregular for the ship's security officer to be higher than lieutenant commander, and most department heads are lieutenants in rank.
Second, once they reach a flag rank, it's quite likely that even career security officers will switch over to a command-colored uniform, since they are now a part of the admiralty. By that logic, while a branch Chief of Starfleet Security (or whatever the title actually is) is still the "top cop," he's a command officer by virtue of his duties (administrative oversight).
Davy Jones
"Frightened? My dear, you are looking at a man who has laughed in the face of death, sneered at doom, and chuckled at catastrophe! I was petrified."
-- The Wizard of Oz