Buying a LineageOS-supported device doesn't necessarily help. I bought a Pixel 2 from the Google store, and later replaced it under warranty due to a bad microphone. Now the bootloader is permanently locked, and security updates ended in 2020. This is a widespread issue with no known solution:
https://support.google.com/pixelphone/thread/14920605/google...