It’s pretty hard to tell at this stage, what might have happened to the plant as a seedling. We have more questions than answers. Sorry!
Was it crowded or too close to other plants? Is there chewing damage or rot on the stem? We can’t see that from this photo. The distortion could be caused by application of some fertilizers/insecticides when the plant was young. Maybe there was some “drift” from a product being applied? Thrips and leafhoppers can be problematic, but so can viruses.
Did it bloom? How about other cosmos in the garden? In spite of it’s contorted stem, the rest of it looks pretty decent.
If you have some of these answers and want to send another photo of the gnarled/twisted area, please write back.
Thanks so much.