In a course's settings, a teacher can choose "This course is not available to students."
Doing so, makes it so the course is no longer available to that teacher.
It seems strange that you would allow a teacher to disqualify himself/herself from viewing his/her own course.
To overcome this bug, the site admin can assign the teacher the role of "Administrator" for the course, then the teacher can work with a "hidden" course.. This way the teacher is allowed to work on creating a course that is not available to students.
Perhaps there is some way that you can make it so the site admin doesn't need to do this.