The key words are "under pure gravity loading" which means if there was no wind, earthquakes or occupants. These forces are more significant the higher the building. I wouldn't be surprised if including wind would halve the limit.
I also think they mean something that could be practically recognised as a building. You can build much higher if you are not restricted by a traditional proportions of a building (for example a pyramid or dome).
As to the building sinking -- it is not a difficult problem to solve. The reason some buildings face problem is that this is just a cost issue -- they guessed they need X amount of effort to provide stable base for the building and they guessed wrong. In practice there exists very simple algorithm to provide stable base -- drill to the rock face and use the underlying rock rather than possibly unstable ground. The reason this is not always used is because it can be very costly.