How I replace the HDD of mycloud gen2

What firmware are you trying to load? You should be attempting loading the v2.x firmware for the second gen single bay My Cloud if one is able to load up the safe mode screen.

2.41.116 (12/08/2020)
https://downloads.wdc.com/nas/My_Cloud_GLCR_2.41.116.bin

If one is still having issues, try stepping through the directions again on the second gen single bay. One should not be getting errors if the hard drive was partitioned exactly as indicated in Fox’s directions and the commands were issued correctly for the second gen single bay.

Edit to add: If the latest OS3 firmware for the second gen single bay My Cloud fails to load, one can try using an older version of the v2.x second gen single bay firmware.

WD My Cloud v3.x, v4.x and v2.x Firmware Versions Download Links
https://community.wd.com/t/wd-my-cloud-v3-x-v4-x-and-v2-x-firmware-versions-download-links/148533