IANAL but I think yes and no? I think you're still obligated to pay your loan payments, but there's also a concept of "netting" where in certain circumstances you are entitled to what you describe.
Definitely don't take my word for it, just throwing this out there as maybe a starting point for more research.
Definitely don't take my word for it, just throwing this out there as maybe a starting point for more research.