It seems that @Brad only answered the second part of your question. For the first part, in the sentence
The last thing I expected was for him to come back.
"expect for" is not the same as in the link you provided. In fact, here "except" and "for" don't even go together. Rather, the sentence should be divided into three parts.
The last thing / I expected / was for him to come back.
The object of "expected" is "thing". And what was the thing that the speaker was expecting? "For him to come back".
A word on the structure "for sb to do sth":
This is frequently used when you need to specify the performer of the action. For example:
It is inappropriate to leave a baby unattended.
It is inappropriate for parents to their baby unattended.