Not sure if we are agreeing or not.
I am referring to the vertical CG, I.E. the wing is above or below the CG, not behind or in front as it relates to normal stability calculations and lift.
Yes the engine also will create a pitching torque if above or below the CG, but that torque will not change with flaps, only the sum of all torques will.
The engine is irrelevant to this discussion because the exact same effect would happen in a glider.
Or to put it another way, since our assumption is that we start from a steady state flight, the sum of all torques must already be zero, and we are only changing one, the flaps, we can ignore the engine.
HiTech