That does work, kind of. I used to do the same thing, until I realized from research and from experience that it takes more CO2 flushing than pushing/siphoning a liquid (starsan solution) out and replacing the liquid with pure CO2.
The other problem has to do with residual oxygen still in the flushed container, there is still a potentially a good deal of oxygen left behind. 1% oxygen in the carboy/keg can still cause problems with DO (dissolved oxygen) in beer, that works out to 10,000 parts per million still in the container. Most breweries try to limit DO levels to 50 parts per billion, and some achieve as low as 5-25ppb. It's an amazingly low amount of oxygen. Even at the higher threshold of 300ppb, it's an extremely low level but is considered to be too high. Staling begins very fast at that level. That's why it so important to reduce oxygen levels as low as you can.
It's very hard to get to those levels with simple homebrewing equipment. New Belgian Brewing did a test with a Blichmann gun, filling bottles from a keg and afterward sent the same bottle to the lab to test for DO levels. They ranged anywhere from 20ppb to 400ppb, showing that low levels can be achieved with a simple Blichmann gun, but high levels crept in as well. They gave a presentation at the 2017 AHA convention and for me it was eye opening. The best advice they gave was to "cap on foam", let the foam come out of the bottle and cap it as it flows. Simply cracking a bottle of beer and recapping caused DO levels to exceed the threshold of 300ppb and staling in the beer in less than a week. Sometimes it doesn't show up right away, the staling comes across as a diminished malt or hop character. Another flavor that appears is a sweetness in the beer that wasn't there before, it's not a pleasant sweetness either. Bitterness gets sharp and unpleasant.
Homebrewers need to be careful when handling finished beer, replacing a liquid in a vessel with CO2 is one way to keep the DO levels down, bottle conditioning is another way because the yeast act as an anti-oxidant. With low levels of DO, the beer will keep longer, hops will remain fresher longer and the malt will stay cleaner and crisper longer. It's a daunting task, but I think it's well worth it. I have seen a marked improvement in my beers since I started using these methods.