I don't know that I would call it a "proof", exactly, but the reasoning described in the post, which is based on a well-known thought experiment of Einstein's, is valid, at least as far as establishing that the energy of radiation confined in a box must contribute to the rest mass of the box in order for energy and momentum to be conserved. But that doesn't necessarily establish ##E = m c^2## as a universally valid equation.