Do you use exactly the same code as used in the sproc?
Or did you replace a few variables in the query with hardcoded values?
It seems like the compiled version of the sproc is based on a different sample data distribution as the ad-hoc query leading to different execution plans...