SOLVED: iCloud Notes Spinning Wheel, iCloud Keychain will not turn on
My iCloud Notes stopped syncing, signing in and out of Apple ID, restarting the iPhone, but it did not help, in fact it made iCloud Keychain disabled. After Apple Support call and factory reset of the phone, situation was the same, except that in addition to the previous issues App Store could not connect.
Another call with Apple Support pointed me in the right direction. Settings -> General -> Reset -> Reset Network settings (somehow factory reset does not clear them). Phone restarts, you enter Settings -> Apple ID and sign in to Media and Purchases. Things started to work. Then I enabled WiFi again and it was the same story.
Solution:
Just change your WiFi DNS settings as your ISP is pointing you to wrong Apple servers.
Settings -> Wi - Fi -> press the 'i' icon next to your connected WiFi -> scroll down and tap Configure DNS. Remove all DNS servers and enter Google's name servers:
8.8.8.8
8.8.4.4
Everything will now work as expected. Dont forget to go to Settings -> Apple ID and enable Media & Purchases.