Palaeontologists are not in a good position to comment on bacterial flagella. Better to consult biochemists. The Wiki article on flagellar evolution (here: https://en.wikipedia.org/wiki/Evolution_of_flagella) has this to say: "There is good evidence that the bacterial flagellum has evolved from a Type III secretory and transport system, given the similarity of proteins in both systems. All currently known nonflagellar Type III transport systems serve the function of exporting (injecting) toxin into eukaryotic cells. Similarly, flagella grow by exporting flagellin through the flagellar machinery. It is hypothesised that the flagellum evolved from the type three secretory system. For example, the bubonic plague bacteriumYersinia pestis has an organelle assembly very similar to a complex flagellum, except that is missing only a few flagellar mechanisms and functions, such as a needle to inject toxins into other cells. The hypothesis that the flagellum evolved from the type three secretory system has been challenged by recent phylogenetic research that strongly suggests the type three secretory system evolved from the flagellum through a series of gene deletions. As such, the type three secretory system supports the hypothesis that the flagellum evolved from a simpler bacterial secretion system."