Near surface underground is different.
Aquifers and all manner of other things behave differently to your blanket "AFAIK temperature doesn’t get cooler underground" and it's well known in practice that digging down a few stories evens out the tempreture compared to above ground.
This even works as a cheap passive cooling system for data centers: