Because your temporary string went out of scope once the Sandbox constructor returned, and the stack occupied by it was reclaimed for some other purposes.
Generally, you should never retain references long-term. References are good for arguments or local variables, never class members.