This looks to be a reasonable sale for the company. I'd imagine it is being done in light of the US anti-money laundering issues. It is a bit puzzling the company would buy the stake in 2020 only to sell it 5 years later but clearly they see more opportunity in buying back their own shares at discounted rates.
I would imagine they are going to utilize some of this capital to grow their businesses in Canada as well, as the US portion of the business is going to be impacted for the forseeable future until the asset cap is lifted. And if we look to the Wells Fargo asset cap as an example, US regulators are very stingy when it comes to removing these types of penalties.
Effectively, I'd view this as the bank betting on themselves. They'll buy back shares and spend the additional capital to reinvest back into its Canadian businesses and any other opportunities it sees outside of the US retail end. Whether it pays off is difficult to tell, as they'll have a new CEO at the helm.