Your attorney will want to review your purchase agreement along with any title insurance that you may have received.
I can provide you with the names of a few attorneys that you may want to talk to.
I'm confident that unless there is a foreclosure on record, some entity owns it and will eventually come out of the woodwork. The lien will survive any chapter 7 regardless of whether it was surrendered or not. The liability for the debt is gone in the BK but again, the bank (Or other legal owner) will have to foreclosure to exercize their rights.
If the HOA foreclosed, they did so subject to the right of the senior lien holders, and junior lienholders for that matter. Their rights were not wiped out in the foreclosure by an HOA.