Whenever you create a roof, especially at a higher storey than ground floor (default), always ensure that you are working on that corresponding Floor Level before doing proceeding to create the roof. This will help you work on the roof and its corresponding walls within the same viewport.