Your sentence doesnt use the noun form of rest, that's why. Same idea expressed but not the correct grammar point. This section is practicing the ~ing that turns a verb into a noun. Resting in this sentence is a noun.
Because that is wrong. "To rest" is not what is important. "Resting" is what is important. One is infinitive and one is gerund. To English speakers, they may seem identical, but there are differences.