Hi and
to the forum.
Looking at you photos, it is definitely the red and black battery wires that have been tugged out completely due to an insufficiently secured axle.
I suspect the axle nuts may not have been done up tight enough to prevent the axle from spinning
(the tabbed torque washers alone would be unable to withstand the maximum torque generated by the Magic Pies.)I strongly advise fitting some additional torque arms to prevent the axle from spinning again after the wiring has been repaired and the wheel refitted.
I think that the molded multi-connector block
(the one that the battery cable has been pulled out of) will contain a small circuit board where some of the wires are joined.
(Check out this post for more wiring details.)As the thick power wires have been pulled out completely, I suspect that the excessive force on the cable may also have torn away the tracks on the circuit board where they were originally soldered onto it.
I suggest you very carefully cut open the molded body of the multijunction unit with a sharp modelling knife etc. to obtain access to the battery wires coming from the motor. Hopefully you will be able to resolder the detached battery cable directly to these wires to create an effective repair.
Apply some silicone sealant and then bind the joint with insulation tape or heat shrink tubing if the wiring repair is successful.
Unfortunately, it is impossible to say whether
(or not) any of the other wires may have been damaged internally by the tremendous tension applied to the motor harness when the axle spun.
If the damaged connector cannot be repaired
(or its connections bypassed completely) I don't think that a replacement motor harness can be purchased separately, so you may need to purchase
a replacement controller instead that comes with the motor harness already attached.
Please keep us informed with the progress of this repair.
Alan