Beans: "That's a Spanish Dagger. But around here we just call them the Walking Cactus […] there's an old legend they actually walk across the desert to find water."
My first challenge in researching this topic is that there is something called a "walking cactus," but it's actually a prehistoric arthropod. The Diania species was recently discovered in China, and is one of the earliest examples of arthropods. But even though it's called a "walking cactus," it's not what we're looking for.
I wasn't able to find any evidence of actual legends regarding cacti that walk across the desert at night. In this case, I think the legend was just a convenient fabrication by the script writers in order to tie in to a key event near the end of the movie. (I won't say which one, to avoid spoilers.)
However, there is a cactus known as the "walking cactus." And there is a cactus called the Spanish Dagger. But they aren't the same thing.
The "walking cactus" (Stenocereus eruca) is a truly unusual form of cacti. It lives on the Baja peninsula, and is also known as the "creeping devil."
Picture a cactus shaped like a single long tube, about six feet long. The cactus has a recumbent form, which means that it just lies there on the ground. It grows from its top end, and its bottom end is constantly dying off. Thus, as it grows, it maintains its same length - but it moves, ever so slowly, across the desert floor.
In its ideal climate, the Creeping Devil can "walk" as far as two feet a year.
The Spanish Dagger, the cactus featured in the movie, is not actually a cactus. It is a type of yucca plant, Yucca gloriosa. Also known as the Spanish Bayonet, this cactus grows in a single tall column. As it grows, new leaves form at the top, and older leaves die. This give the Spanish Dagger a characteristic shaggy appearance, as seen in the movie.
The Spanish Dagger is actually native to coastal American sand dunes, from North Carolina through Florida. Although they have been transplanted across the country for use in yards and gardens, they are not native to the desert terrain where Rango is set.