I be getting really confused when one config boots from /dev/sda, but when I have my backup drive attached (not the boot device), it boots from /dev/sdb
Hell I dunno, I probably confused the hell out of my laptop plus myself with my cutout mod reconfiguration, but it’s happy to boot from almost anything now.
You probably just have multiple boot entries and some are higher priority, so if you plug in a drive it's boot config is higher in the boot order and since it is available it'll boot that.
Just run
efibootmgr --unicode
You can see all of the entries and their boot order.