From my experience if you stay on the Google flagship/Pixel line then everything is great. Pretty much every other vender is garbage and will screw you and you'll have the experience you're talking about.
I typically tell people if you want an apples-to-apples (no pun intended) comparison, you can't compare iOS to Android. You need to compare iPhone to Google Pixel. If iOS was open source and available for 3rd parties to roll-their-own, you wouldn't take a cheap "iPhone" maker and compare that against the latest Pixel Pro, so the reverse shouldn't be done either.
It seems though in the latest iteration at least, the Pixel 6 is actually worse than the Samsung S22. And frankly I've often felt like Samsungs were the flagship Android phones, not Google's phones.
Kind of a late comment but I really do wish Samsung would make a serious attempt at a "stock android" type of device that was affordable, because I think they would kill it. Their phones have always seemed really high quality to me, but so expensive, and the S2 that I had back in the day was riddled with Samsung versions of apps that I didn't want.
I owned a Pixel 1 and a Pixel 3 and they were two of the worst phones I have ever owned. You couldn't pay me to take another Pixel phone. I now rock a much cheaper Motorola which is fantastic.
Last time I had a Sony phone (Xperia Z5), the hardware was quite nice and the software was nearby stock Android, except for some apps like launcher, camera or gallery, which were a slightly nicer than the stock ones.
But they were on a strange schedule, they released a new flagship every 6 months instead of every year. They of course could not support all the models at the same time, so the support was shorter that competition.