My solution how to fix the screen goes black when calling or Proximity sensor doesn't work correctly.
Samsung A5 2016, no root:
Settings - Display - Screen Mode
Default setting was "Adaptive Display" and after I changed it for the next one "AMOLED Cinema" everything works fine.