I've had eight to 10 vehicles in the last 15 years and most all of them had sunroofs.... None of them gave me any problems. Sunroof technology has come a long way since the leaky old flip tops of years ago. If that was the only thing that held me back from buying the vehicle, forget about it and get what you want. Pull the shade over it and forget it's up there.
While I don't disagree that the construction has come a long way, it may be worth nothing that, unless you got used vehicles, going through that many vehicles in that many years reduces the likelihood that you were the current vehicle owner if issues ever popped up.
With that said, I have a roof on my '23 Suburban and it's been issue free for two years. First year was kept outside in the AZ sun though it's now kept in a UT garage so hopefully that preserves the seals better against the harsh sun/winter cold.
My main complaint with a sunroof is losing the roof handle above the doors which I frequently held onto when in a burb without a roof; it still has the grab handle on the front side of the door to help with getting into the vehicle though that's too far away to use as a grab point when sitting in the seat unless you have longer arms than I do.