I haven't bought an android device for a few years, but the last time I did, it was also a very cheap one for testing. I chose an "Android One" to avoid all these issues. Is something like that still an option?
Your best bet might be one of the Pixel "a" series, which are Google's budget-oriented models. Stock vanilla Android with as little bloat as you can hope for.
Those Pixels have options to open bootloader and after flashing custom ROM that is much cleaner (GrapheneOS) to lock it again. Which is currently most secure way to have clean and secure android device.