We are investigating the error with initrd flash. In the mean time, these are the workaround
First workaround
First, determine what NVMe controller your NVMe SSD is on.
If your NVMe SSD is on c4 controller, use command
sudo ./flash.sh jetson-orin-nano-devkit-nvme internal
If your NVMe SSD is on c7 controller, use command
sudo UPHYLANE=c7x2 ./flash.sh jetson-orin-nano-devkit-nvme internal
Since you have tried the first flash.sh command and it gets stuck, I think you NVMe SSD is on the c7 controller so you can use that.
The downside with using this approach is that you cannot ever remove that SSD from that NVMe slot, otherwise you cannot boot the device. If you are not ok with that, run this flash command to reflash the qspi:
Second workaround
First flash the qspi:
sudo ./flash.sh -c bootloader/generic/cfg/flash_t234_qspi.xml --no-systemimg jetson-orin-nano-devkit-nvme internal
Second, follow Flashing Support — NVIDIA Jetson Linux Developer Guide 1 documentation to flash the NVMe SSD by attaching the NVMe SSD to a host PC