Start out with a Glock 17, which is listed in the Production Gun List, as required in D7 19 to be legal for CO. Remove the slide and barrel, and replace them with a 6" barrel and corresponding-length optic-cut slide, as allowed in D7 21.3. D4 7 requires that a gun fit in the "box" in order to be listed on the Production Gun List, but the equivalent requirement for Carry Optics, D7 7 ("Maximum size Handgun") is "No". D7 21.3 just says "SLIDES: You may replace the slide with an OFM or aftermarket slide. BARRELS: You may replace the barrel with an OFM or aftermarket barrel." Neither D7 21.3 or any other section I could find requires that the replacement slide and/or barrel length be the same as the factory slide and/or barrel length on the factory gun when it was approved to be on the Production Gun List. D7 22 "Specifically prohibited modifications and features" doesn't apply, because D7 21.3 specifically allows replacing the barrel and/or slide.
This scenario seems to be against the intent of the rules, but allowed according to the text. Agree?
Note that I'm not saying that shooting a 6" 17L-length gun in CO would necessarily be any better than shooting a 4.5" 17-length gun, just that it appears to be allowed as long as you modify the gun correctly. Starting out with a factory Glock 17L would not be OK, because the 17L is specifically called out in the Glock section of the Production Gun List as not being approved.
Technically, the reverse appears to be true too. If you took a Glock 17L and put a 4.5" barrel & slide on it, it would still have started out life as a Glock 17L, and therefore would not be on the Production Gun List, and not legal for CO. It would be nearly impossible to detect though, and I doubt anyone would care.