This is a good one which has happened to a friend of mine.
She owned a property subject to a mortgage to one bank and a charging order in favour of another. Even though it would have had to have been paid anyway, she instructed her solicitor that the amount owing in respect of the charging order was to be paid out of the proceeds of sale. On completion (at the end of last year) the solicitor accounted to her and she did not bother to look at the completion statement - she is that sort of person. Anyway, she has exhausted what she received paying off other debts and carrying out property maintenance and currently has no funds to discharge the charing order. She has just received a letter from the bank's solicitor asking what her plans are to repay the debt. Upon investigation it appears that somehow or other the charging order was not cleared off on completion and the new owner has it on his title. It is not known at this stage if my friend's solicitor gave an undertaking to discharge the charging order.
If an undertaking was given my friend's solicitor would have to clear the charge, but presumably he can recover the amount (? less any interest which has been added since completion) from my friend.
If no undertaking was given then the buyer can insist that his solicitor clears the charge, but presumably the solicitor can recover the amount (? less any interest which has been added since completion) from my friend.
The interesting question, perhaps unlikely to arise since one solicitor or the other will have to clear the charge, is whether if the charge were not discharged the bank would be entitled to an order for sale even though the value is small compared to the value of the property. The argument would be that the bank expected to get paid on a sale and it is not its fault if the owner failed to ensure it was repaid. If an order is not given a charging order is effectively no security at all.