Switching a mainboard’s firmware between UEFI and legacy BIOS might discard the UEFI boot menu entries in the mainboard’s NVRAM
Here's how to recreate a missing UEFI boot menu entry (in the mainboard's NVRAM) via efibootmgr - as well as how one could end up with such an entry being missing, and what error you might see when that entry is missing.