and now, lest he stretch forth his hand, etc.: And if he were to live
forever, he would be likely to mislead people to follow him and to say
that he too is a deity (Gen. Rabbah 9:5). There are also Aggadic
midrashim, but they cannot be reconciled with the simple meaning.

As such, if the Midrash is commonly cited (in Rashi's day, perhaps) and he feels it contradicts the basic understanding of the Pasuk, it makes sense for him to refer to it and reject it (which he does in other instances*). Similarly, if it's a commonly cited Midrash that distracts from the basic understanding, rather than enhances it, it makes sense for him to refer to it and refocus the reader's attention to the basic Peshat.

One explanation is that Rashi is not satisfied that his explanation fully addresses the question(s) on the verse, and references the Medrash to say that the Medrash's explanation does resolve the problem, but is too far from Peshat to be included. See here #9, and the sources quoted there.