This is very very dangerous. The >sandbox.cfg overwrites sandbox.cfg entirely, and doesn't wait for sed to finish reading before it does so! If sed doesn't read in the entire file before the shell truncates it, much or all of it could be lost! That's probably what's happening when you don't use cat. With the cat, it takes a fraction of a second longer, giving sed a chance to read at least some of it (but NOT guaranteed to be all of it).
If you have Linux, you can use sed -i '/expression/' filename to safely edit the file "in place". It creates a temp file, then replaces filename with the temp file.
If you don't, you have to use a temp file yourself:
sed '/expression/' < input >/tmp/$$
# 'cat' is better than 'mv' since it won't alter input's ownership or permissions
cat /tmp/$$ >input
rm /tmp/$$