At what point will we not need to advance scientifically? Is there an endgame?

Of course it depends on what that particular religion teaches.
There's the rub.

One problem is that religion tends to teach a lot of fantasy along with teaching how to be the best we can be and all that. It spends a lot of time fixated on speculating about the motives and desires and demands of unevidenced supernatural beings, for instance.

A lot of religions also teach how one can be the most obedient one can be to the demands of that particular religion.

Religions can also be oppressive. Instead of teaching people how to be the best they can be, they actually end up restricting their followers' freedom to be who they really are, instead channeling them along pre-defined life paths that deny them agency and happiness.

Some religion leads to long-term psychological damage.
One day, people will delude themselves into thinking themselves omniscient, and begin to use phrases like: "The science is settled"
Seems odd. Why would anyone need to claim omniscience to recognize a settled matter of scientific description or inquiry?
then science will stagnate until sanity returns and people understand that they are ignorant about so many things,
Clearly not much of a general worry at the moment - maybe in a few hundred years, or if the present civilizations collapse from plague, war, scientific ignorance, willful rejection of scientific knowledge, etc.