As recommended by the maintainer of the mgcv package, Simon Wood, it might be better to set method = "REML" in the gam() call for geom_smooth(). I quote:
REML smoothing parameter estimation is less prone to occasional under-smoothing than GCV (e.g. gam(..., method="REML"))
As recommended by the maintainer of the mgcv package, Simon Wood, it might be better to set
method = "REML"in thegam()call forgeom_smooth(). I quote: