But if strange didnt give up the time stone thanos wouldnt be able to snap, and also he wouldnt have the stone from visions head if strange didnt give uo the time stone. The ancient one wouldnt have to give up the stone because strange would still have it
Not really. Strange saw 14 million scenarios, this one was the only one that worked.
If he doesn't give up the Time Stone then a lot of what happens at the end of Infinity War doesn't happen, true. But still ends with Thanos winning somehow.
Like, what Strange supposedly saw was:
Scenario 1-14 million: Don't give the Time Stone but somehow, Thanos gets it and decimated everyone eventually. There were other scenarios where maybe he actually used the Time Stone to battle Thanos, but that didn't end up working either. In others the big purple fukker might've taken 2 more years to accomplish his goal, but he still came out on top.