I can not reproduce the problem with the missing line.
And regarding the searchbar placement: That's the standard position for a searchbar with the navigation bar on iOS16 and 17. I can't change that. This position is predefined by iOS and also hardware specific. On iPhones it will be placed centered.