Thermal resistance effect on anomalous diffusion of molecules under confinement