If you could post the Mathematica code for your two approaches that would help. Use the code formatting tool at the top of the posting area to format that code. But, to help this along, here is your function (with lambda set to one for simplicity):
testFunction[t_, w_, z_] :=
g[w] + Cos[4 \[Pi] (z + g[w] Sin[w t])] +
g[w] Sin[w t] Cos[4 \[Pi] (z + g[w] Sin[w t])]
Let's evaluate it for a particular set of values so that we can experiment with numerical integration:
testFunction[t, 1, 1] /. g -> Identity
gives
1 + Cos[4 \[Pi] (1 + Sin[t])] + Cos[4 \[Pi] (1 + Sin[t])] Sin[t]
Multiplying this by Sin[t] to get the first Fourier coefficient:
NIntegrate[
Sin[t] (1 + Cos[4 \[Pi] (1 + Sin[t])] +
Cos[4 \[Pi] (1 + Sin[t])] Sin[t]), {t, 0, 2 \[Pi]}]
which gives
1.06691
Now try multiplying though with the Sin[t] funciton (which of course is the same thing as the above:
NIntegrate[(Sin[t] + Sin[t] Cos[4 \[Pi] (1 + Sin[t])] +
Sin[t] Cos[4 \[Pi] (1 + Sin[t])] Sin[t]), {t, 0, 2 \[Pi]}]
which gives:
1.06691
Now do the NIntegrate term-by term:
NIntegrate[Sin[t], {t, 0, 2 \[Pi]}] +
NIntegrate[Sin[t] Cos[4 \[Pi] (1 + Sin[t])], {t, 0, 2 \[Pi]}] +
NIntegrate[Sin[t] Cos[4 \[Pi] (1 + Sin[t])] Sin[t], {t, 0, 2 \[Pi]}]
giving
1.06691
This gives some warnings that look like *NIntegrate failed to converge to prescribed accuracy after 9 \
recursive bisections in t near...*, so let's examine the individual terms. This one
NIntegrate[Sin[t], {t, 0, 2 \[Pi]}]
gives
2.72352 10^-16
and generates the above message because it is so close to zero. Similarly for this one:
NIntegrate[Sin[t] Cos[4 \[Pi] (1 + Sin[t])], {t, 0, 2 \[Pi]}]
giving
-6.52256 10^-16
Finally this one gives the original answer:
NIntegrate[Sin[t] Cos[4 \[Pi] (1 + Sin[t])] Sin[t], {t, 0, 2 \[Pi]}]
giving
1.06691
If this represents an example of your calculations perhaps you dropped a factor of something some where? Or perhaps the particular case you computed (e.g., higher order terms in the Foruier series) involved a detailed cancelation between two terms which caused numerical issues?