Hi, I'm in actual geophysics .. and you're linking to a phenomenon (quick, read your own link) that occurs over a scale of tens, hundreds, and thousands of kilometers.
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:
https://pawsey.org.au/groundwater-cooling-system/