If you’re looking at the hardware, from personal experience, iPhones do last much longer than android. I have been on both ends and I do know for sure my old iPhone 5s still works great so many years down the line. So, I’m guessing you’ve got a good bet if you’re looking for long term usage.
I haven’t used the Pixel 6 Pro but I have been an iPhone user for the past five years and I’ve got to say, no matter how much people may criticise Apple, it has its own perks. Hope you enjoy your new cell phone.