Failed to init device STM32F446RE

So you are talking about the specific Nucleo-F446RE board or a custom board with a STM32F446?

Have you installed a recent version of the ST-Link driver https://www.st.com/en/development-tools/stsw-link009.html in order to flash the board?

Also if Linux is your host OS, you need to install udev rules.