it's a good try, but the judge does say the prisoner will hang "at sunrise on one of the seven days next week".
i'll offer two possible solutions. the first solution depends on the validity of knowledge. suppose you say to a friend, "i have a hunch that the time is 2:37pm" and then you look at the clock to find you were absolutely correct. did you "know" the time? or suppose i ask you "what is the square root of three rounded to the nearest thousandth?" and, really having no clue but you had just been reading a book about george washington and found that he was born in the year 1732, you say "1.732". you'd be right, but did you "know" the answer?
the first solution hinges on the belief that hunches are not knowledge. in this scenario, the lawyer was incorrect to deduce that if the prisoner were to hang on the last possible day, it still would not be knowledge.
the second solution defines the paradox. suppose the prisoner has no logical skills whatsoever, and the lawyer simply wants to leave the courtroom. the prisoner likely will think to himself "well, my guess is that the judge will hang me at some point early in the week but not right away. " the judge could then hang him any day, and will not contradict the need for surprise. but in the puzzle's scenario, the entire gamut has been laid bare by the lawyer. the prisoner knows he cannot hang on any day, so he will be surprised if he does hang.
the key is this: in this scenario, the lawyer is also wrong to deduce that the prisoner cannot hang on the last morning. knowing that he cannot hang on that day, he can hang.