For example let us take the reaction:
Zn(s) ---> Zn^2+(aq) + 2e^-(aq) ;ΔG°, which we are considering as our half cell
And now suppose, by taking the value of E° of SHE(Standard Hydrogen Electrode) as zero and using it as reference, we have measured the E° of the zinc electrode. But clearly this value is relative to SHE and not the absolute value.
Now we have the equation ΔG°= -nFE° , relating the change in Gibbs energy of the half cell reaction and the value of E°. The change in standard Gibbs energy of a reaction is constant at a constant temperature and has nothing to do with the chosen reference electrode so how can we relate both the values?
My another doubt is why even bother defining a reference electrode if we can find the electrode potentials of a half cell with its change in gibbs energy. Or is it the other way around, that we calculate the value of ΔG based on the measured value of E.