Stopping the electricity supply is not a straight-forward process. The line is connected to the grid and such high loads cannot be randomly connected or disconnected from the grid without making appropriate arrangements.All sections along the route have to be switched off or else it can be dangerous if the loco passes from a powered section to a section that has been shutdown.
They could have just diverted it towards a sand-trap or any dead-end siding, but it's weird why didn't do so.