If you are using compose and edgeToEdge is enabled, you can use Modifier.displayCutoutPadding() or Modifier.safeDrawingPadding() to get rid of this issue.
Do not try to apply the padding yourself by using WindowInsets.displayCutout.asPaddingValues() because it will not work.