The DBGMCU_IDCODE and DBGMCU_CR debug registers are accessible only in debug mode (not accessible by the user software). When these registers are read in user mode, the returned value is 0x00.
The function you call reads the IDCODE register. That's why you see zeroes.
Retrieving data ...