Not really. High density urban environments actually work well, for air source units and even deep geo. The average temperature in a town is higher, so the temperature gradient is less, and any heat which escapes from a dwelling can be locally captured.
I have to disagree. The temperature difference is only couple of degrees even in very large urban environments like central London. Heat escaping from buildings rises to escape while the colder air resulting from air heat extraction remains below and will pool in the high density building zones. That in turn will make further heat extraction from the reducing temperature air more difficult, a self defeating cycle.
There will be a similar effect with shallow depth heat extraction, closely coupled as it will be in a very high density building area.
I suspect you may not be considering the sort of building densities I am, 50 dwellings per acre being the current London guideline. Even in my over 50 year old low rise zone it's 35 per acre. In another example we have some 44 storey slender tower blocks on in my London borough, each with over 500 homes. A further one under construction is 68 storeys. Extracting heat for all those homes from such tiny footprints will be somewhat miraculous!
Of course far higher standards of insulation, heat retention and solar gathering in buildings could make a big difference, but we seem to be making no real progress in that direction, other than in a very few idealistic schemes where cost hasn't mattered. And costs can be a huge stumbling block with heat pumps. That for the small ten storey 30 home block I mentioned is £700,000 for the bore hole heat pump system only, so over £23k per flat which immensely exceeds the cost of any other heating installation. And that's on top of the £3.2 millions block refurbishment cost.
.