No, you didn’t.
Well, technically, you did discharge your personal liability for that second mortgage, but it was and it is still attached to your home.
When you file a chapter 7 bankruptcy, it discharges almost all of your debt, including your mortgages. However, this just discharges the debt from you personally. If the debts are secured by a house, you still have to keep paying those debts if you want to keep the collateral.
You can chose to reaffirm the debts and re-assume personal liability for them. That way, they report positively on your credit. Or, you can keep that personal discharge but still keep making payments on the loans. So long as you keep paying the mortgages, you will keep the home. Eventually, you’ll even pay if off and own the title, free and clear.
However, just because you received a personal discharge doesn’t mean that the mortgage was discharged from your home.
In a chapter 7, you can strip (remove) non-consensual liens, like judgments, from your title. You cannot strip consensual mortgages. This means that you cannot strip or remove a mortgage that you signed and agreed to.
Now in a chapter 13, you can sometimes remove a 2nd mortgage if there was no equity in your home to secure that second mortgage. However, that involves some fairly complicated court filings, and you would know if that had happened.
If you receive a friendly phone call from your 2nd mortgage lender advising that you are in arrears for missed mortgage payments, you need to either work out a repayment plan with them directly, or maybe even file a chapter 13 to catch up on those missed 2nd mortgage payments. Otherwise, they can and will foreclose on your home.
That being said, they can take the home, but they cannot sue you personally, because your personal liability for the 2nd mortgage was discharged by your chapter 7.