In our case it was proxy, the proxy admins were introducing new proxy server and it was causing the issue.
So to solve the issue
- Check proxy logs, that it is not blocking access to WSUS
- Configure bypass to WSUS server
- On client side check that proxy settings are correct, go to Control Panel -> Internet Options -> Connections -> LAN Settings
- Use command netsh winhttp show proxy to check system proxy settings
Restart SMS Agent Host service after configurations have been changed, so SCCM client could use the new proxy settings.