@AWildDUK As others have mentioned, I don't think it's that she had made that batch at home and brought it to school, because then he would probably have been derailed into considering what it would mean that she'd bring cookies, to school, for him.
I think the issue is more that did take her words at face value and guessed that she was only trying to get rid of some cookies she herself wasn't particularly satisfied with. Then after his sentence she suddenly brings up a notebook and starts making a whole
thing about how she's going to make more and better cookies and basically try to become a patessier or smth, and from there we come to your conclusion after all. He feels that he defo didn't live up to her expectations (or level of interest) about those cookies. He basically rained on her parade.
(He might also suddenly have coupled his cookie grading to her earlier comments about how it would have been nice if he could be a bit more positive in how he grades things. Anyway, the "complex emotions, I don't know what to do here but I think I did maybe should have done something differently" summary for his angst is probably an apt one)