In Bolivia, it is called toborochi, meaning “tree of refuge” or “sheltering tree.”1
When the world was still very new, the Aña, or spirits of the darkness, liked to abuse and murder humans. Then they found out that Araverá, the beautiful daughter of cacique Ururuti, who had married the god Colibri (Hummingbird), was pregnant and would give birth to a son. The spirits believed the son would punish them when he grew up, so they decided to kill Araverá.
With the help of a flying seat her husband Colibrí had given to her, Araverá fled from the village, but the evil spirits followed her and harassed her wherever they found her hiding.
Tired, she decided to hide in the trunk of a Toborochi tree where she gave birth to her son in peace. The boy grew up and fulfilled the prophecy, killing the spirits and avenging his mother, who had to stay inside the tree until she died.
Forever buried in the amphora-shaped trunk of a Toborochi, Araverá likes to come outside in the shape of a beautiful flower that attracts hummingbirds, that way, she keeps contact with her husband. This legend is from Santa Cruz, Bolivia.
Thanks to Karen Clark’s excellent article for SF Gate Home Guides on trees “with the spiky bark,” I was able to track this one down. I searched “tree spiky bark.”