"could not find any previously installed systemd-boot"

UPDATE UPDATE:

The issue came back. I posted a separate topic here.

But basically I tried to upgrade the system using nixos-rebuild switch and during the process it just crashed/quit the window manager and showed a blackscreen and white cursor and just hang there. I forced the machine to shutdown and boot again. It successfully boot into the WM but when I tried nixos-rebuild again it showed the message

could not find any previously installed systemd-boot

Wasn’t this issue already solved? Am I missing something or doing something wrong? Please help!

Thank you!