How Rendering animation All scene
The code probably is working as expected, but it’s doing something else you didn’t know it was doing: when blender runs Python code, the UI stops. This usually isn’t a problem since most code finishes within a few seconds, but in the case of this code, render times are being waited on. So until all the scenes finish rendering, the UI would be frozen. I agree with the commentor that suggested you run the code in a minimal blend file with just simple cubes and short frame ranges in each scene to test this diagnosis.