Could a bank simply eliminate a loan from its books?
If Mr. X hasn't used the money, so it's all still in a deposit account at the same bank, then the bank may be able to cancel the loan. Whether they can or not, will depend on the exact contract attached to the loan.

If Mr. X has withdrawn the money as cash, then that transaction represented a drop in the bank's liability to Mr. X of 100, and a drop in the bank's assets of cash-at-hand of 100.

If Mr. X has used the money in a digital transaction, then they can no longer cancel both at the same time, as the asset of the loan is with Mr. X, but its matching liability will be with another party.

In either of the last two cases, the bank can cancel the loan, reducing its assets by 100. The balancing transaction will be a reduction in the bank's equity of 100 - i.e. the bank records a net loss on the loan of 100, and the shareholders make a loss of 100 on the transaction as a result.

(because assets = liabilities + equity)