Daniel Radcliffe came up with the idea that, as a gesture of respect to a teacher that Harry most certainly looked up to, he would wear a certain type of clothes that resemble the outfit worn by Prof. Lupin in his lessons from Harry Potter and the Prisoner of Azkaban (2004), during his teachings. The director liked the suggestion, so that became the basis for his look during those scenes.Source:bellatrixblack-