All 3 (paired t-test, mixed effect and gls with compound symmetry) are
fitting the same model, and so should give the same result. That is what
you see with the first example. The gls model is not getting it wrong
except for the df.
For the second the 3 model results should again be the same. I'm not
certain why but it may be numerical. Even though the data come
from a model
that isn't correct for the fitting that should be irrelevant, it is the
data that produce the model fit not the model that produces the data.
Possibly estimates of the correlation are poor when there is little
correlation, and that flows through to the mixed effects and
gls results.
The relationship to the unpaired t-test is probably irrelevant. Note also
that the default for the t.test is unequal variances whereas for a mixed
model it is equal variances.
The df for gls is obviously in a sense a bug. Getting the df for a mixed
model isn't easy. Here we have a nice simple correlation structure and
there is an obvious correct answer, but usually there isn't one. If the
model assumed uncorrelated data then the gls df would be correct, so it is
necessary for the software to work out what is going on. Using parametric
bootstrapping to determine the underlying distribution seems a better
method if accuracy is important.
Ken