No, Harry Potter didn't know when exactly he first thought about purposely getting himself into detentions with Umbridge. But one thing he knew for sure: He didn't want them to stop. (Trigger warning: self harm, mentions of child abuse and suicidal thoughts)
Harry never would have guessed that waking up as a female lemon could be so eye-opening and life-changing.