I never knew that. I have giant Yucca's in my yard. The bigger ones produce a stalk yearly, the smaller one's don't tend to produce a stalk until they get larger. After looking it up it says to eat the stems or stalks they must be boiled or baked first to remove saponins, which are toxic. The flower also has some saponins and it recommends if you are going to eat the flower raw to try one petal first to see if you have a reaction. Like an upset stomach or irritation in the throat. If that should occur they recommend boiling them first or you can make a tempura batter and fry them. It also cautions that when first starting out eating edible flowers to always start slowly introducing them to your body. There is also Yucca with two "c's" and Yuca with one "c", the difference is described as: While yucca and yuca are not botanically related and are native to different climates, they do have the similarity of being used as a food source. The two get confused due to that missing “C,” but yuca is the plant you may have tried in trendy Latin bistros. Yuca is the plant from which tapioca flour and pearls are derived. Yucca, on the other hand, is most notable for its more common use as an ornamental plant specimen. It is an evergreen plant with stiff, spine tipped leaves that grow around a thick, central stalk. It is commonly seen in tropical or arid landscapes.
Read more at Gardening Know How: Yucca Uses – Can You Grow Yucca Plant As Food https://www.gardeningknowhow.com/ornamental/foliage/yucca/yucca-plant-as-food.htm
RE: Yucca Flowers