Shalom Rav, In Bereishit if the earth did not do as H” said in producing fruit tree producing fruit ( i.e every part of the tree should taste like fruit ) then why is it written .. vayehi ken (And it was so).
ב"ה Shalom Rashi on the Torah (Bereshit 1:11), command quotes the Midrash that the earth did not fulfill G-d's wishes and did not produce trees with the same flavor as the fruit and therefore later when man was cursed was his sin, the earth was also cursed. Taking Rashi as is, it is not that G-d's creation not fulfilled but the earth rebelled against G-d's will and therefore there was punishment. But then the question is, how could the earth go against G-d's will, it doesn't have free will? The Bartenura on the Torah, seems to give the simplest answer, which is that man was supposed to toil in the earth so the tree would taste like the fruit and when he was cursed so was his ability to bring about the taste of the tree to be like the taste of the fruit. It is not that the earth had a mind of its own. All the best