There is a triangle of camera quality, software support, and peripheral support. You can have 2.
Fairphone is the close, but they removed the headphone jack when they upgraded their camera in order to push their shitty earbuds that they only sold/supported for 2 years I think before scrapping them and are continuing the cycle with their new headphones (directly contrary to their mission). They also refuse to add simple wireless charging.
Sony has camera quality (only their photo pro, not in their shitty default camera app) and peripherals, but no software support (2 years max).
Voting with my wallet is buying no phones ever, apparently.