You're on the right track, but you shouldn't get gain from a mismatch or even from a perfect match. Best you can do is 0dB loss.
I think there is a key point here that GV should see is that the calculation is for uncertainty not a specific statement of power. For example, if you put a power sensor on the tracking generator and do the calulation for uncertainty (let's ignore the sensor system uncertainties and just consider the SWR reflection, basically the sensor perfectly sees the non-reflected power) the the reading on the sensor is +/-X from the actual power being delivered.
So as you tweak the TG to get your 0dBm reading the true power there will be 0dBm +/-XdB.
Personally I always try to abide by the laws of thermodynamics (I hear the fines can be a bitch) so the overall system, assuming that it is passive, will have a net loss - When you get to the end of the system, as radioactive said, you should be whatever you started with minus some power however your final measurement will still have some +/- variation.
Given the original situation of input to an amplifier, you can consider the output, attenuators, cable and input to be passive and calculate what the power is, +/-, that the active part of the amplifier sees.
TonyG