Your Debian-installer basically treated your SDCard adapter as a fixed disk, and installed the UEFI bootloader on the ESP partition. And after that, it did one more thing: it used the
efibootmgr command to register the bootloader into UEFI NVRAM boot variables.
Before unplugging the adapter, everything worked just fine: the SDCard disk and the bootloader on it was registered in UEFI boot order. But apparently your system's UEFI firmware has one feature: on boot, if it detects NVRAM boot variable entries referring to a disk that is not present, it assumes those entries are no longer needed and deletes them. Without the NVRAM boot variable, the UEFI firmware no longer knows to look for
/EFI/debian/grubx64.efi on the ESP partition of your SDCard.
Others have suggested copying the UEFI bootloader to your hard disk. That would work, and would allow you to boot from your SDCard... but only on that specific system.
There is another solution: plug your SDCard to any system that can access FAT32 partitions on a GPT-partitioned disk. You should be able to use that system to access the ESP partition on the SDCard, find the
EFI directory in the root of that partition, the
debian subdirectory inside it, and the
grubx64.efi file inside that.
Then create a new subdirectory within the
EFI directory, named
Then copy the
grubx64.efi from the
debian subdirectory into the
boot subdirectory. Within the
boot subdirectory, change the name of
When a 64-bit UEFI PC is looking for a UEFI-style bootloader on a removable disk, this path -
/EFI/boot/bootx64.efi on a FAT32 partition - is what it's looking for. When that file exists, the UEFI BIOS should detect the SDCard as bootable in the UEFI style. Since the OS name is part of the UEFI NVRAM registration, it won't appear as
UEFI:debian any more, but it might appear as
UEFI:<model of the SDcard> or something similar instead. And now your SDcard should be again bootable, not only in one specific computer, but in any computer that allows UEFI-style boot from removable media.