Normally, boot order is determined in BIOS on the fly and can change any time a difference in boot sources is detected. To try this, boot into BIOS with a USB drive plugged in - it will show up in the boot order. Which one is first is by logical preference: UEFI boot file first if found on any drive, then the drives. You can disable unwanted choices and reorder them in BIOS and those will be remembered until BIOS detects a change in the drives.
When booting goes wrong like that, check the SATA and power connections to drives. Are the drives spinning during POST?
That display code is strange and looks like garbage. I suggest clearing CMOS - see the manual for whether your motherboard model uses a button or a jumper. You will have to apply settings or a profile again.
If that doesn't fix booting, and the drives appear to be working, perhaps BIOS needs to be re-flashed.
Jeff