They attempt to sell it at market-rate which, assuming the previous owner intentionally under-valued the house, would earn them money that they can use to continue the program.
Which they won't do if it's assessed appropriately.
See California's Proposition 13 for the alternative.
i guess we're at an imagination stalemate now
The only way to end up with a loss is a coordinated attack by owners and potential buyers: to intentionally understate the value, and then to hold off ANYONE attempting to purchase before the market sale price is below the compelled price. So multiple rich people lose their houses in a naked gambit to bankrupt the government. I mean... I guess it could happen? But at that point, it's open class warfare.