Fredrick ii's failure despite his success as an enlightened despot was: He failed to provide a successor to his throne.
He was having a problem in his decision to have a child because he is a victim of an abusive father. So in the end, after his fall, the throne was succeeded to his nephew