Your height map has too few sampling depth resolution, resulting in those hard steps. Probably your height map is 8 bit, giving you a max of 256 height levels. Now if your height map is is higher planar resolution than 256, the lateral resolution is insufficient to represent a smooth heightfield.
Solution: Use a higher sampling resolution for your height map. 16 bits are a popular choice.
Your shader and baking code are fine though, they just don't get input data with enough resolution to work with.