Windows hangs and crashes when removing the boot device

Hi developers!
Now I am doing a project on operating systems and computer security for a my university.
One of the tasks is to place the Windows EFI bootloader on a USB flash drive (not on the main hard drive!);
I hoped that it would be enough to copy the contents of the hidden EFI partition to a USB flash drive, but I ran into unexpected difficulties.
Windows boots fine, yes.
But if I remove the bootable USB flash drive after logging in, three scenarios are possible (on different physical machines the system behaves differently, on virtual machines it also behaves differently. I suppose it depends on the physical USB controller):

  1. System immediately crashes wint bsod SYSTEM_THREAD_EXCEPTION_NOT_HANDLED
  2. System hangs (doesn’t respond to any user input, but responds in the debugger), after 1 minute crashes with bsod INACCESSIBLE_BOOT_DEVICE (without memory dumping!)
  3. Everything continues to work fine (Hehe, my personal computer turned out to be a unique device - this behavior appeared only on it)

Having looked at the dump, I found out that in case 1 an access violation occurs due to dereferencing nullpointer in the function and ExNotifyBootDeviceRemoval
In case 2, the problem manifested itself in ExpWaitForBootDevice.

I tried to examine the situation in the debugger, but I didn’t achieve significant results.
Which direction should I go?
Has anyone come across a similar one?

Memory dump (for case 1) on GoogleDrive: https://drive.google.com/drive/folders/1Ewd96Gr6wYRPGIfXxKDlYvmjRwQchJr_?usp=sharing

Thank you in advance!

When I took out the USB stick before logging in, the OS was working fine. But after I reinserted the USB stick and pulled it out, everything repeats (1, 2, 3)

The BCD file is used by the system, so it has to exist. If you remove the flash drive, the system wont be able to access the BCD file anymore.

Why kind of university asks you to copy the EFI partition to another drive anyway ? This feels like malware related. Most likely trying to boot other computers with a patched bootloader from a flash drive without having to keep it plugged in, stealthly.

Everything continues to work fine (Hehe, my personal computer turned out to be a unique device - this behavior appeared only on it)
I bet my life your personal computer is a laptop. Laptop manufacturers usually cache everything in the ram to boot faster. So those files are not really read from disk, they are in memory.

@ThatsBerkan said:
Why kind of university asks you to copy the EFI partition to another drive anyway ? This feels like malware related. Most likely trying to boot other computers with a patched bootloader from a flash drive without having to keep it plugged in, stealthly.
No, this is a VeraCrypt encrypted partition with OS.
@ThatsBerkan said:
I bet my life your personal computer is a laptop. Laptop manufacturers usually cache everything in the ram to boot faster. So those files are not really read from disk, they are in memory.

No. Case 2 happens on my laptop (not PC).