It may not be a bad idea for your friend to call his lender as well to explain what is going on. Now recall that the title insurance policy is protection in the form of a payout. The policy itself will not prevent the foreclosure. Also the title insurance policy that protects your friend is not the same policy as the one that protects your friends lender. When you were in escrow there was a search that was done that went through the title history of the property. This is where that lien would have been identified.
Now my guess and it is a big guess… Is that all of this was indeed identified in the report and somehow ndex screwed up when the original trustee sale happened. I could be very wrong though so you never know.
I think a call to ndex right off the bat can straighten it all out.