'X-Men 1' - I did a cameo.
In the case of 'Thor,' it was just casting the best people for the part. Ken Branagh had the idea to cast Idris Elba as Heimdall, and we didn't blink at that chance to do it.
Rejection is a common occurrence. Learning that early and often will help you build up the tolerance and resistance to keep going and keep trying.
You can drive yourself crazy and tie yourself in knots trying to anticipate what someone's going to like or not like, and doing test screenings and opinion polls. But pay too much mind to that, and you'll wind up with a big pile of mush.
Kenneth Branagh has his stamp all over 'Thor.'
'Iron Man' and 'Iron Man 2' are as Jon Favreau films as you can see.