Counterfactual-based Root Cause Analysis for Dynamical Systems