Buffalo, you keep making this claim and misunderstanding how evolution works.
The previous steps to say, the flagella, wasn’t working towards a working flagella. It was doing other things…proton pump or waste removal or something completely different…each step of which was good enough at doing whatever it was doing with mutations occurring that changed it slightly over time to arrive at our current time where it is a motor unit with flagella attached. It probably isn’t done evolving either though we have no idea what direction it will take other than whatever it becomes, it too will be something that is good enough to help it survive.
The mousetrap was always designed to be a mousetrap. We weren’t nor were each of our parts. Some of our parts are very obvious how they developed and some are still mysterious or partially mysterious. And plenty of them have left their evolutionary marks along the way. Please quit making this mousetrap claim. It appears as a very foolish argument.