Everyone thought Gay would get a max contract offer as a RFA. What surprised people is that the Grizzlies didn't let him get that offer and just match it, instead they offered the max themselves.
Really, everyone? I think there was shock that Gay got such a big deal. Part of that was the shock of Heisley opening his checkbook but Gay becoming a max player also played a part. Really, I have zero connections and am just guessing but I have a hard time believing that everyone thought Gay was worth a max deal or would get one.
A max deal from your own team is a bigger deal (longer term) than one you can get in FA. So yes people were shocked with the deal Memphis gave him. But it was expected he'd get offered the max for a RFA and that Memphis would match.
I doubt it simply because Gay has never played at a max level and there is no way the consensus around the league was that he would get a max offer.