Handling NoData value when converting the dB band to 'uint8' data type

Hi everyone,
I have an issue with the converting COSMO-SkyMed data in dB scaling to ‘uint8’ data type. The issue is when I set nodata value to 0 in QGIS, it also applied on the main area of raster instead of the border only.

Before applying the nodata value:

After applying the nodata value to 0:

I suppose the problem in the following processing step:

When I checked the minimum pixel value of the dB band is negative value instead of 0, and the nodata value is set to 0. The problem is when it scaled to ‘uint8’ data type, the 0 value in main area is also counted as nodata value.

The question is how to handle the problem in order the nodata value is only applied on the border.
Thank you.

can you please describe all steps you performed in SNAP? Maybe this can be solved differently.