This makes more sense if it's laid out in something like timeline order and with some more clarity on the parties involved.
WB makes the movie for $70 million, but shelves for whatever reason and treat the $70 million as a loss. On that loss, they get a $30 million tax writeoff.
Movie sits in "vault" for a while.
Ketchup, a distinct entity, not a WB shell company, buys the movie and distribution rights entirely from WB for $50 million. This forces WB to give back the $30 million tax writeoff, meaning that for WB it's minus $70 million, plus $30 million, plus $50 million, minus $30 million. So they end up with $20 million more than they had with the tax writeoff, but also ended up $20 million in the hole. Ketchup meanwhile, has a clean slate with a complete movie they got for $50 million.
Ketchup then takes their $50 million dollar movie and spends an additional $10 million on it for marketing, making their total cost $60 million. To make that up, they only have to make $60 million dollars, not $120 million. However, they don't own the movie theaters. Essentially, the cost to them for having the movie shown in the theater is half the box office price. So, in theaters, every dollar of ticket revenue is fifty cents for them. So, movie theaters need to make $120 million for Ketchup to get back their $60 million. However, to complicate things, Ketchup owns the complete distribution rights, so they can also make money on other media, streaming, disks, television, etc. not to mention that they also sold some of the foreign distribution rights for $20 million up front. Then there's the complicated question of merchandising. Ketchup owns distribution rights, but I don't know what their merchandising deal is. WB still owns the character copyrights and trademarks outside of the fixed forms for the movie, while Ketchup clearly has promotion rights. In theory they have a profit sharing agreement for merchandise based specifically on the movie, but it might get complicated where merchandising and promotion collide. Like T-Shirts, or happy meals, etc. While the lawyers probably hammered things out in minute detail, I still would not be surprised if we see a lawsuit over this at some point down the road. In any case, the extra demand for merchandise from WB that the movie will create will probably also make back WB's $20 million loss as well.
In any case, at its current pace, it is pretty much guaranteed to make $120 million at the box office, making it at least break even in theaters, then it will receive additional profit in other media.
That does lead to the question of whether WB would have made a profit since it cost them $70 million to make it. So if they had then spent say $14 million on marketing it for a total of $84 million, they would have need $168 million in box office sales to reach break even. So there's the question of whether they could have turned a profit. It looks like the movie is going to hit right at around $120 million at the box office, but with the extra they would have spent on promotion, it's possible it would have also gone further. Then of course there's other media. Ultimately, in the long run, it probably would have at least gotten close to break even. That might lead some to say that WB was right to not release it. Except that meant only taking a $30 million dollar writeoff, when it still would have brought in much more than that. On the other hand, when they consider competition at the box office, they are also competing against themselves, so they probably also consider whether they think they will get more of a pie slice (if they think of it as a zero sum game) if people go to see another movie and its one of theirs. So, their reasons may have been complex.