It really is a shame how phones are made. Firmware has to be signed by the vendors, so you CAN'T upgrade it. I mean, if there was a big community they maybe could handle the Kernel maintenance, but not the Firmware.
I highly recommend you getting a Pixel 8 with GrapheneOS. It has very long lifetime, even though Google kinda sucks when it comes to hardware features. Their a models seem to have actively crippled Cameras (comparing a Pixel 6a to a 4a, it is worse! Not to speak of a Nokia 7plus which is years old).
But they are the only good one poorly, as they fully support running a Custom OS on it, including all hardware features. Samsung actively blocks custom OSses from accessing those.