Is heightMapSampler maybe defined as sampler2D? It should be sampler3D or sampler.
And then there is always the more modern alternative: texture.SampleLevel(sampler, float3(1,1,1), 1);
As ever @markus, you are a star, while I was not using sampler2D, I was using samplerCUBE, which I thought was OK, but changed it to sampler3D and now I don’t get the error