Ubuntu's install of grub always goes to first drive.
I only experimented once with Debian, just to see if I could install grub to sdb, rather than Ubuntu's default of first drive. And it worked, so I know Ubuntu installer is issue, not grub.
External drives with UEFI always boot using /EFI/Boot/bootx64.efi. And you choose that from UEFI one time boot menu.
Most UEFI systems remove a UEFI boot entry or modify it when a drive is unplugged. So if you installed & it created a Debian or grub entry, that may not be a correct UEFI boot entry when drive is unplugged.
I pretty much have Kubuntu on many drives, both external & internal. I can boot all external from UEFI boot menu using the /EFI/Boot/bootx64.
But usually use a grub boot stanza in my system to boot external drive from grub menu. Sometimes I have to edit grub as I boot as drive in boot stanza is not correct or change hd0 to hd1 or vice-versa, I now prefer labels. Depends on if I also have another drive plugged in and drive order that UEFI has defined.
examples from cavfan
https://ubuntuforums.org/showthread....6#post13816046
Using 40_custom & Custom menu
https://help.ubuntu.com/community/Grub2/CustomMenus
I still have multiple larger flash drives with full installs, but now prefer SSD for external boot. My latest is a SSK USB to NVMe adapter.
Code:
menuentry 'SSK noble' {
search --set=root --label ssk-noble
configfile /boot/grub/grub.cfg
}