Einstein thought experiment involved a box with a shutter that could open and shut so rapidly that it would allow only one photon to escape at a atime. The shutter is controlled by a precise clock.The box is weighed exactly. Then at a certain specified moment, the shutter opens and a photon escapes. The box is now weighed again. The relationship between energy and mass ( renember E=mc^2) permitted a precise determination of the energy of the particle. And we know, from the clock, its exact time of departing the system. So there !
Einstein, a majestic figure, walking calmly with a faint ironic smile, and Bohr trotting along by his side, extremely upset.