I believe you have to disable zha before you attempt to flash. You can't have something actively working with the adapter while trying to flash it. The easiest way is to just drop the adapter into a desktop computer.
If you are looking to use Z2M you have to stop ZHA. You can't have two different software packages attempting to access a single adapter, it's basically like trying to flash while in use. Alternatively you can buy a second adapter and use that for Z2M and keep the original wiring with ZHA.