When you start exercising to lose weight, some temporary weight gain is normal, but it's not muscle, it's water!
This expert answer explains why: www.sparkpeople.com/community/ask_the_expe
My question is what do you mean by "Staying within my caloric range with a surplus of 500 calories each day"? Your calorie range should take exercise into account already, there's no need for "surplus." Could you clarify?
Even when everything is perfect, our bodies aren't calculators; sometimes other facts come into play, like sleep patterns, the time of the month, sodium intake, and the kind of exercise you do can all affect weight.