According to what I know, If you invoke function F on Contract C, you pay the gas fees related to F's operations and if for some reason something goes wrong, all state changes performed by F until that point are revoked. F works in an atomic way and the human being account that invoked F pays for the gas fees (even if operations are rolled-back).
The doubt I have comes from a situation in which F invokes some other function F1 on Contract C1, which can invoke some other function F2 on Contract C2 and so on.... human -> (C) F -> (C1) F1 -> (C2) F2 -> ...
First of all, it is my understanding that the original account would only pay for the gas fees of operations performed by F, then it would by C who pays gas fees for operations performed by F1, C1 would pay for operations on F2 on so on....
But what if Fn fails? would all state modifications performed by F up to Fn-1 be rolled-back? would the original account as well as contracts from C up to Cn-1 waste their gas fees?