Don’t gerunds function as nouns (Subjects, Direct Objects, Objects of Prepositions, etc)? If so, I don’t see how they could function adverbially.
My advanced grammar book from the 1950s puts it this way: “Just as an ordinary noun may function as an adverb, so may a gerund.” Examples are “He is fighting mad” and “Anything
worth doing is worth doing well.” gww