When I try to directly check out your fork of mbed-os, I get errors like this:
./mbed-os/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h:369:11: error: no type named 'qspi_inst_t' in namespace 'mbed'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
I also tried to integrate your code into my checked-out version of Mbed OS. I still got the same 4002 error returned from bd.init().
NOTE: this is on a custom board using a Winbond W25Q128JVSIQ. The STM32H7 board is a NUCLEO-H743ZI2. This board works fine with the NUCLEO-F746ZG STM32 board.