jk,
Your questions are a little confusing, especially this early in the a.m. but. . .
This is no different than someone selling the home with the buyer taking over the underlying debt (not through a lender approved assignment but more likely through a typical “wrap” closing).
Ignoring the "due on sale" clause, which, in most states is not enforceable, the lender's interest in the property is simply as collateral for the loan. If the loan is not paid the lender forecloses. The borrower is named as someone who was in the chain of title and who is still on the loan. Such would be the case no matter what since the borrower is in "privy of contract" and, under the mortgage/deed of trust must be notified. The foreclosure may be reported to the credit bureau and may impair borrower’s future attempts to finance a home purchase but, other than that, it is not a big deal.
Should the property sell at a foreclosure for more than the lender's credit bid, once again, those with some sort of interest in the transaction will be notified. The borrower is notified, not because he has an interest in the property - which he doesn't since he transferred title to the buyer - but because he is on the mortgage/deed of trust. The proceeds of the sale are interpled either to a court or to the county treasurer for proper distribution either to a junior lien holder, HOA or to the owner of the property (in this case, the buyer). If borrower thinks he has a right to the proceeds he can voice that right but I doubt he gets anything.
In OP's case there is a court order divesting the ex of any ownership interest in the property. What we don't know is what happens if OP is unable to refi. Typically the decree calls for the sale of the property, which, depending upon what is owed and the value of the property, may mean a short sale and - good luck with that.
Des.

