CMake Git operations such as shallow clone can cause unexpected failures due to too small INACTIVITY_TIMEOUT in ExternalProject or FetchContent. Be sure to set INACTIVITY_TIMEOUT to a large enough value. 15 seconds is too short a timeout for Git shallow clone, for example. Consider 60 seconds or larger INACTIVITY_TIMEOUT.
Also check the user ~/.gitconfig file for timeout:
[http] lowSpeedLimit = 1000 lowSpeedTime = 60
If lowSpeedTime is too short, this download failure can also occur. Set to 60 seconds or more.