Try including that check first, e.g.

=IF(AND(C2>0,C6>0),"Error",IF(C2>=60,(C2-60)*5+105,IF(C2>0,105-(60-C2)*5,IF(C6>=60,(C6-60)*6+106,IF(C6>0,106-(60-C6)*6,"**")))))