A better question is how could God be surprised by the actions of His creatures?
It is a teaching verse. One among many.
People always do what they were preordained to do.
When I do what I'm supposed to do I think He is quite surprised. In fact Heb. 2:11-12 says He is so surprised He whips put His wallet with my picture and tells everyone around Him I am His brother and He's proud of me. How about that?
I agree. Since God is all-powerful, all-knowing, and never wrong...how could it be possible for someone to do anything other than what God knows they will do?