Harry had decided to explore the castle since it was the Christmas Holidays, and Ron had been hanging out with the twins, who were showing him one of their newer creations. Per his promise to Severus, he avoided the third-floor corridor and explored the abandoned classrooms instead.