The reason that those features are not defined in the SDK is because it can cause a runtime issue if the user doesn’t have the correct configurations.
Are you trying to access the memory in those SRAM regions (ITCM0 and DTCM0 banks) after disabling them? If you want to save more power by setting the SRAM banks into low power retention state or power off state in the stop mode, you need to make sure you’re not accessing the SRAM bank that you enabled the retention for.
It seems in your code you enabled the retention for the ITCM0 and DTCM0 banks. Is there any code running in these banks?