When the Bar at the 1st Lind disappear, the Display is initializied in any matter.
The contrast setting before and after Initializing of Display are different.
Try to Display some Text on the Display and readjust the contrast voltage again.
Without Initializing the first Line of the Display should Show a black Bar, the second becomes blank.
That with the Bar is depending, how the Display controller is connected to the LCD.
Some show an half Bar at the first and the second Line, other do a full Bar at the First and a Blank Line at the second.
Look if the Port's of the ATMEGA are conected right manner, right direction ( input Output? ) and not used for other Functions like debug Wire, Fosz out and so on.
Some of that functions can be enabled in the Fuse settings.