The Government is committing theft by any reasonable definition.
I also expect that if they can’t keep the profits then they will just put the homes they foreclose on for sale for the owed tax amount. They won’t even try to get what it is worth just to spite the homeowner.
So I would say it is better to sell before they take things away.
There are plenty of instances where they "legally" do that.
They are generally sold at public auction, so that a fair market price can be had. Otherwise the clerks at the county assessor's office would be real estate magnates.