The time stone can reverse time and bring him to life. However it will also reverse the effects that caused death. Like with vision, they destroyed the stone so he reverts back time to before the stone was destroyed. In this case tony dies because if the power released from using the gauntlet. To save him then they would need for him to not use the stones, and that would mean thanos never dies. The same concept is followed with black widow.