In my opinion both deaths were important to the universe being saved.
also, I realized that without the rat, Scott wouldn't have come back, without scott the time travel idea would've never came to play, without the time traveling they would've never been able to get the stones, without natasha killing herself for the soul stone, they wouldn't have been able to get all the stones. And without all the stones, Tony wouldn't have been able to save the universe.