Really odd behavior with notes in tuplets

It seemed like you posted it because you had a question, to wit:

I can straighten it out using the horizontal spacing tool but am wondering how something like this can happen at all?

Unfortunately, we can’t answer that question without seeing the project. Next time, please consider posting the project rather than a picture when you first post the question. (This is part of our standard set of guidelines for people requesting help on the forum, which you can read here.)