There's so many hidden variables in this calculation.
To start with, it's looking at the performance of all champs in the same position, and the S grades only go to the top 4-5% or something. Maybe other Ahris are doing pretty well this week.
Besides KDA and cs, it also looks at wards placed, wards destroyed, camps taken from enemy jungles, kill participation %, how fair the match was MMR-wise, how much of a stomp it was, and then probably more stuff we haven't figured out yet. 160 cs at 42 minutes is fairly weak, and may have just gated you out of the S-tier by itself. It downplays kills on opponents of significantly lower level (the same way xp gains do), so if a bunch of kills were from you roaming bot & picking off an easy underleveled Ali, that probably has something to do with it too.
Mostly though, just try not to think of not getting an S as 'doing something wrong' but as just doing awesome when you do get it. At least that's what I tell myself after a dozen As in a row...