I will quote here the bible of cooking science, Harold McGees "On Food and Cooking":
"Dumpling doughs are minimally kneaded to maximize tenderness, and benefit from the inclusion of tiny air pockets, which provide lightness. [...] This tendency to rise with cooking is due to the expansion of the
dough's air pockets, which fill with vaporized water as the dumpling
interior approaches the boiling point and make the dough less dense
than the surrounding water."
Following this, your dumpling must be a proper dumpling - dough that was only minimally kneaded, while altitude does not matter.
Why does this coincidence with being ready?
[...] the starch granules absorb water molecules, and swell and soften as
the water molecules intrude and separate the starch molecules from
each other. This granule softening [...] takes place in a temperature
range that depends on the seed and the starch, but is in the region of
140-160°F/60-70°C. The tightly ordered clusters of amylose molecules
require higher temperatures, more water, and more cooking time to be
pulled and kept apart than do the looser clusters of amylopectin
molecules.
So, altogether, the starch molecules do not absorb much more water as they are done, so the remaining water can vaporize and fill the air pockets, which makes the dumpling float then. Or, in other words, a floating dumpling is actually overcooked and so guaranteed to be ready (if the preconditions are met).
Does this rule ever fail?
Yes. Your dough needs to have sufficient air pockets for floating. Your dough needs to be made out of starch that is willing to absorb water. A dough made out of waxy potatoes has a fair chance to not float in time. This does match with German recipes for potato dumplings using waxy potatoes, that warn about the dumplings falling apart due to overcooking, if there is too much water in the pot (as it takes too much time for the dumpling to rise).