Two of the largest banks in Europe have had to make abrupt pivots at the CEO position this year. Each has chosen to pass the baton to their former chief risk officer.

When Barclays CEO Jes Staley stepped down Monday after learning of preliminary conclusions reached by British financial regulators investigating the extent of his relationship with convicted sex offender Jeffrey Epstein, the bank picked C.S. Venkatakrishnan to assume the group chief executive role (pending regulatory approval). Despite Barclays’s board expressing disappointment regarding Staley’s departure, the bank noted it was prepared to make the move, having identified Venkatakrishnan as its ideal candidate more than a year ago.

At that time, Venkatakrishnan was serving as the bank’s group chief risk officer, a role he held from 2016-20. He was promoted to head of global markets and co-president of Barclays Bank last year to better position him to assume the CEO mantle.

“The Board has long been confident in Venkat’s capabilities to run the Barclays Group and is delighted to have such a strong internal candidate,” the bank said in a statement. “The Board is confident that Barclays under his leadership will continue its strategic direction and improve performance in line with the progress of recent years.”

Flash back to April, when ABN AMRO was ordered to pay €480 million (then-U.S. $575 million) in a settlement with authorities in the Netherlands to resolve money laundering allegations. The scandal made its way to Denmark’s Danske Bank, where CEO Chris Vogelzang announced he would step down after learning Dutch authorities planned to name him as a suspect in connection with their investigations.

Danske, which was perhaps not as prepared as Barclays to make a change at CEO, picked Carsten Egeriis for the job. Egeriis had been the bank’s chief risk officer the past four years and had previous experience in risk management at Barclays.

“I am pleased that we have a strong and competent successor in Carsten Egeriis,” Board Chairman Karsten Dybvad said in a statement at the time. “He has had a pivotal role in our remediation efforts and in the strengthening of the risk area over the last years and not least in the bank’s handling of the corona crisis. … [T]he Board is confident that he is the right person to lead the transformation that is already progressing well.”

The importance of the chief risk officer at a financial institution has never been more apparent. Take Credit Suisse as an example of what can go wrong. The Swiss bank’s deficient risk culture was faulted as being behind the missed red flags that led to $5.5 billion in losses when U.S. hedge fund Archegos Capital Management collapsed earlier this year. In the aftermath, Credit Suisse parted ways with Chief Risk and Compliance Officer Lara Warner and has also since rebuilt its risk presence on the board.

A story from Bloomberg Law last year quoted a former corporate risk management executive saying a CEO once told him he helped him sleep better at night. Perhaps that shouldn’t be the case, with the CEO looking over his or her shoulder instead at the person best positioned to replace them should things go wrong.