This is a known issue. At the moment there is a workaround to enable the torch/flashlight and shutting down while the flash is on.
Have a look at this list: ✏ Android 7 update: most annoying bugs, FAQ, etc
Maybe you’ll stumble over other problems that are already described there.