The wiring has been pulled. Follow the cable from the wheel back to the controller in the frame and ensure all the connectors are snug. If there's a connector between the two (some don't), make sure it's pushed fully home. If the cable has been yanked at the wheel end, you'll need to remove the wheel entirely and check continuity of the cable to the controller and the connections within the motor.
There's really no need to remove the wheel to fix a puncture; there's enough room available to part remove the tyre/tube sufficient to patch and refit.