We know that when the verb in the subject is a form of the verb "do", we have to use the infinitive form of a verb. For example,
The only thing I can do is (to) give him money as compensation. - correct
The only thing I can do is giving him money as compensation. - not correct or less idiomatic
However, why when the verb in the subject is not "do", both genrund and infinitive form are acceptable?
Example 1
(1) The only action she performed was to withdraw the money.
(2) The only action she performed was withdrawing the money.
Example 2
(1) The task he does might be to turn on the TV.
(2) The task he does might be turning on the TV.