This was explained by the Ancient One and Banner. We know that returning the stone will return the reality back to the main timeline, or effectively stop it from branching at all.
We know that when a timeline is changed by removing an infinity stone, it creates a parallel one without the associated infinity stone. Clint's grief is still real as he has basically just abandoned her on another planet and has no clue if he'll see her again. She could set her suit's return point to after the final battle, so as to make sure she didn't interfere with the one ideal timeline where Thanos was defeated. He told them what was going to happen and explained that for things to work out, Nat would have to remain on the planet as if she had died. So, instead, I think Cap went back and stopped Clint and Natasha when they landed on the planet. This would completely screw up all kinds of things going forward in that timeline. He could just profit off Black Widow's sacrifice.
When Thanos got there in the other timeline, he would just find a stone and wouldn't need to sacrifice Gamora. How could he? What was he going to do - toss it off the cliff? If the idea was to limit disruption to the alternate timeline, that wouldn't work. I don't think Captain America ever went back to 'return' the Soul Stone.
"I've seen a lot of people talking about how the Soul Stone works to preserve souls, and how you can exchange a soul for a soul as a possibility for why Natasha might be brought back eventually, but I think it's actually more simple than that: