After reading this, I re-read the original post and the flaw is fairly simple. Its certainty.
For a start, the prisoner has used an inductive argument. That is one were you start at the end and deduce backwards (If C cannot be true, then I must look at B, but that can only be true when I reach B after A). So, to start with, his argument is based on the certainty that he knows that he cannot be executed on friday. But that only holds true for thursday night. So if the prisoner reaches thursday morning without being hanged, his reasoning is that he cannot be hanged friday, so must be hanged on thursday. But if that is true, then he cannot be surprised. And if he cannot be surprised, then what reason does he have to believe that he won't be surprised on friday. The answer is none. So, if he is certain he will be hanged on thursday (and therefore not surprised) then he cannot be certain that he will not be hanged on friday. That is contradictory to his argument. And if he cannot be certain, then he can still be surprised and therefore still hanged.
It took several reads but I do not believe that this is a true paradox. More an interpretation of the prisoner and guards logic.
Bed, you might care to re-read again mate, it is indeed a paradox, the guard hasn't bought into ths any logic whatsoever, he has just made statements.
It is the prisoner who is arguing his freedom on the basis of what looks like a logical progression ... but therein lies the paradox, because he will get executed ...sorry mate, try again mate !