On my first time in the Nevada desert I was astonished to find that I needed a jacket at dawn to stay warm, after all kinds of daytime heat. Looking at Elko NV's weather this week, it's got highs of 99F/37C and overnight lows of 61F/16C
The sky around where clouds are might be around -20C, while outer space is at -273C or so, so you get much more radiative heat loss in the latter state (clear sky).
(This is also why you’ll see gardeners try to cover their plants when there’s a “frost warning” even though the temperatures won’t be going below freezing).
And from the opposite perspective, the sun is really far away but incredibly hot, so it transfers heat to us, and more as you get closer (and less as you get further away).