In theory you are right, you can considering the various heat losses you have like as thermal conductivity (Lamdba λ).
But in practice that temperature measurements loss are minimal.
The method I use myself in the refigiration has some contact pasta (i don't know is this is the correct english translation) with the sensor mounted on the pipe and then what Armaflex insulation or other insulating material on it that gives the best results.
If you have some time
you can also mount an immersion tube into the pipe that you can use for it.