The flaw in this analysis is the stem reach changes when the angle is changed. Most stems are measured along a line through the center of the steering tube clamp and the center of the handlebar clamp. A 100mm stem in the -17 position should be 100mm long, but when flipped up, the horizontal length becomes 829mm. There are other stem calculators that show the change in reach and height, when a stem is flipped.
That said, most people just change one thing at a time. Change the bars, but leave the stem alone, since any change in reach is very small.