The issue is not simply getting the mortgage. Usually a "name search" is done on the buyer, sometimes just before recording the Deed in your name on your new home purchase. The lien kicks in as an attachment to your new asset-property and that can kick everything out at the last minute.
If it is truly a lien on your name...it will quickly become a lien on the property you buy. That could interfere with the final recordings of your new loan if the older lien has the right recordings in place for it to jump into first place putting your new loan into 2nd position.
The sale can fail very late in the day on this issue. So be sure to check with an Escrow and Title Company as well as the person who will be providing the mortgage on your purchase. It could cause your Lender's Title Insurance to fail.
I have not seen this on one of my transactions, but I have seen it happen on the transactions of other agents I know. It doesn't necessarily come up when your loan is being processed and you are not necessarily covered for this event as to your Earnest Money being returned in the event the sale fails on this issue. You could end up losing both the house and your Earnest Money.
Almost always the lien has to be paid in full for this reason unless it is converted to a "debt paid as agreed" vs a "lien".