This is one of those areas that is hard to explain sometimes.
If the Stored Procedure returns a Rowset and that's all it does, then this value is usually returned. It takes some testing for this.
Otherwise, if there are numerous commands executed from within the Stored Procedure, then the return value of the 1st command is usually returned, not the final (last) value. If you're having issues getting a value returned, it might be easier to have the Stored Procedure write the desired values out to a Temp Table, then read the Temp Table values on a subsequent Query (within the same SQL Task) to get what you need.