Well, something stinks in Denmark.
The lien may or may not have been properly recorded. The foreclosing attorney may have relied on a defective title search. There are numerous scenarios that could have caused this to happen. Humans make mistakes.
The lien either survived foreclosure or not. I suggest seeking competent legal counsel. If you are the lienholder, select your attorney carefully because you want someone familiar with real estate law and the foreclosure process.
If you are purchasing the property, I presume you are insuring the title. The title insurer won't take chances and will want that lien cleared before they insure your title. If you are uncomfortable, seek legal counsel.
I repeat, humans make mistakes. Do not purchase real estate without buying an owner title policy. It's the only insurance that covers human mistakes that impact your ownership.