The fundamental blunder was appointing Grayling in the first place. He had an ignorant, regressive attitude to criminal justice that we haven't seen since Michael Howard. In addition to wrecking the prison service, Grayling did grievous damage to the courts with the Criminal Courts Charge and the massive cuts to Legal Aid. Gove spent most of his tenure as Justice Secretary undoing the damage that Grayling had done.
https://www.theguardian.com/politics/2016/jan/28/michael-gov...