I believe there are two issues with this problem.
The first is obvious; the ESP8266 generates heat, so a temperature sensor placed near any heat source will reflect that by showing an increased temperature reading. Typically this effect will be greatest when a sensor is placed above the heat source and is in the flow of warm air rising away from the heat source. The effect can also occur when the temperature sensor is placed in an enclosed air space with the heat source.
The second issue is less obvious. I would like others to conduct some tests to see if they can confirm the same issue.
I noticed significant heating (2°C) of several different temperature sensors (AM2302, BME280 & BMP280) when placed around 20mm from the antenna end of an ESP8266 NodeMCU on a breadboard. In this case the breadboard was lying flat on a table with good air flow around it. In this case most of the heat should have been rising (ie vertical flow) away from the ESP8266. It is possible there may have been some warmer than the ambient air flowing towards the sensor, but if anything cooler air should have been flowing past the temperature sensor towards the ESP8266. Either way I was surprised to see such a high level of heating in the temperature sensor.
Connecting the temperature sensor with 100mm wires and placing it 80mm away from the ESP8266 provided accurate readings, that is no heating of the sensor.
With the same configuration I moved the sensor to be around 15 to 20mm horizontally from the ESP8266. Again a similar level of heating (2°C) was seen. This eliminated the longer wires as being a factor in isolating the temperature sensor.
I then allowed the temperature sensor to return to the ambient temperature. I then placed a "wall" of 10mm thick foam between the ESP8266 and the temperature sensor. The wall was large enough that warm air wouldn't flow around it to reach the temperature sensor. The wall was also thick enough that no measurable warm air should have been able to flow through to the temperature sensor. However a similar temperature rise was seen in the sensor readings. I think it is highly unlikely that any air warmed by the ESP8266 would have been reaching the temperature sensor.
I used a foam wall instead of an enclosed foam container in case the sensor self heated with the enclosure. This could be tested further if needed.
Then what is causing the apparent rise in the reading from the temperature sensor when placed near the ESP8266?
I had suspected the issue might be radio frequency induced heating. I then placed the temperature sensor in plastic bag and then placed a plastic anti static bag over the top. I have previously tested that these anti static bags are a reasonably good RF shield. Under these conditions, the temperature sensor showed no or very little sign of heating. It would therefore appear that the cause if RF heating.
I would like others to verify these results.