This is harmless. All they did was to remove the tension from the cables. Sure, this means the chain will have some shear force on it from the derailleurs, but it's just the little bit of force from the springs. If it was the other way around, it might be a bit more serious – cables over-tensioned, and a lot of shear load on the chain. In that case it might be worth checking the chain links that were between sprocket and derailleur.
I suspect whoever did this might even have meant well: there is a semi-myth that you should store bikes with released cable tension. See When not used, what gear should I store my bike in for discussion; it doesn't actually matter.
Just be gentle with the bike whenever something like this happens – don't start riding with the derailleurs as they are, instead lift the back wheel and rotate the cranks so the chain can settle without load, perhaps also shift once back and forth with each derailleur to check it's still ok, and to get out of the small sprocket. Then you should be fine.