The node setup depends on the input image. The normal map node expects a height map as input. In your case inverting the image works because stone is higher and darker than lava. But say you have an image of a wall with white bricks and dark mortar, and this won't work.