They don't have to forgive the loan right? They just take the stock back? Then she would owe nothing and have no tax due.
The reason it doesn't seem to make sense is that no actual value was gained in the end. However, the IRS (and our tax laws) don't see it that way. Instead, they back at the value that was gained at the time of the transaction. They don't care what happens to the value in later years.