The verse does not necessarily say that all the Messengers passed. News about a genus does not necessarily apply to all individual members of it. As an example consider the verse:
الذين قال لهم الناس إن الناس قد جمعوا لكم فاخشوهم
Those to whom the people said, "Indeed, the people have gathered against you, so fear them."
— Quran 3:173
Now it is understood that not all of people (every single human in existence) said this. Rather only one man ( Nuaym ibn Masud) or at most a few people from the hypocrites said it. Hence An-Naas does not necessarily apply to every individual Insaan. Similarly what is said about Ar-Rusul does not necessarily apply to every individual Rasool.
Also keep in mind that Muhammad ﷺ was alive at the time of the revelation of this verse. And Muhammad ﷺ is a Messenger. Hence it is understood that this verse does not necessarily mean all the Messengers.
Secondly the verse does not say that the Messengers passed away i.e. died. Rather it means passed or gone - meaning existed before. It is possible that some Messengers did not die but rather passed on by being lifted up alive like Jesus, and according to Israelite reports also Enoch and Elijah. As evidence of this see the verse:
سنة الله التي قد خلت من قبل
[This is] the established way of Allah which has occurred before.
— Quran 48:23
It is understood that Allah's Sunnah has not died.
Point of the verse
The point of this verse is not to say that Jesus is not divine because he is dead. Rather it is an answer to those who claimed divinity for Jesus because of his miracles.
ما المسيح وإن ظهرت الآيات على يديه فإنما جاء بها كما جاءت بها الرسل ; فإن كان إلها فليكن كل رسول إلها ; فهذا رد لقولهم واحتجاج عليهم
Although miracles occurred at the hand of Jesus miracles also occurred at the hand of previous Prophets. So if Jesus is divine then they (previous Prophets) should also be divine. This was a response to their saying.
— Tafsir al-Qurtubi
Being alive in heavens was not the Christian argument for Jesus's divinity. Because they also have similar beliefs about some other Prophets like Elijah and Enoch whom they do not consider to be divine.
In conclusion this verse is not evidence for the death of Jesus. And we have other evidence that Jesus is alive in heavens and will return at the end of times.