It's actually not a bug, but a misconception from us as developers. We've always used the status bar height as the distance between the navigation bar and the very top, however we should be using the safe area's top inset. Until iOS 12, the status bar height has always matched the safe area's top inset, but now they added some padding at the bottom in certain devices.
let topInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.size.height