Levan Gigineishvili's comment made an excellent point:
he may not think of the consequence
Further, there are people who are incapable of thinking about what could happen two steps later. It is too distant and too abstract for them. They can only see the present if that.
He had evidently planned the betrayal out very carefully and well in advance, so why then?
I think you have given Judas too much credit for his intellectual planning,
John 13:
26 Jesus answered, “It is the one to whom I will give this piece of bread when I have dipped it in the dish.” Then, dipping the piece of bread, he gave it to Judas, the son of Simon Iscariot. 27As soon as Judas took the bread, Satan entered into him.
Satan entered into his plan.
So Jesus told him, “What you are about to do, do quickly.”
It wasn't even Judas' timing.
Given the fact that he seems to have known about the plot to kill Jesus, why does he seem surprised by this outcome?
Because Judas wasn't a logical thinker.
Matthew 27:
1 Early in the morning, all the chief priests and the elders of the people made their plans how to have Jesus executed. 2So they bound him, led him away and handed him over to Pilate the governor.
Now the picture of execution became more physical and real to Judas.
3 When Judas, who had betrayed him, saw that Jesus was condemned, he was seized with remorse and returned the thirty pieces of silver to the chief priests and the elders.
He had not thought or planned this far ahead.
5 So Judas threw the money into the temple and left. Then he went away and hanged himself.
If Judas were being logical, he wouldn't have killed himself.
Why did Judas express remorse only after he saw that Jesus was condemned?
Because things were not so real to him until then. He couldn't perceive the logical consequences of his betrayal ahead of time. He might even have thought that Jesus would get out of this by calling on legions of angels.