That's the ideal situation for the bank, they provided the debt financing for Musk, and they've offloaded the risk, maybe they even make a little profit.
What can happen though, is investors say "Hey, interest rates have gone up, Twitter looks really unlikely to be able to service this debt, so we don't think that debt is good, we'll offer you $600m for that debt". This is the debt trading below face value, and indicates investors think either Twitter is unlikely to be able to service the debt, or that the terms aren't good compared to other interest rates.
So the bank absolutely can sell off this debt, and it would get the risk off their books, but they'd take a significant loss - they've lent out $1Bn and got paid $600m. So instead of selling it and realising a massive loss, they'd rather keep the debts on their books until more favourable conditions.
If, as you say, they don't sell the debt, Musk just continues paying the interest to them, unless he defaults in which case they get whatever he secured the debt against - which in this case means a bank would end up owning Twitter.
Between now and then, the risk of Elon Musk / The Crown Prince of Saudi Arabia allowing their company to default are practically zero.
"Musk’s Twitter financing tests Wall Street’s mettle: ‘What could go wrong?’" (April 2022) - https://www.ft.com/content/f60b6385-eef6-461e-9fcc-b3cb999a7...