I had this issue and finally fixed it.
1. Delete the cache of all your Google apps including YouTube, Google, play store play services etc.
2. Go to settings, apps and notifications, see all apps, 3 dots, reset app preferences.
3. Reset your apn and reconfigure it.
6. On your apn settings under apn type, enter "default".
4. Go to settings, advanced, mobile manager, data usage, control app data usage, untick all from wifi and then tick all, go to mobile data and again untick all and tick all.
5. To check if it worked disconnect from wifi, go to the dialer and dial the code *#*#426#*#*
If it worked you should be able to connect to Google servers.