Hello!!
Your issue is directly related to the ribbon cable connector between the main and UI PCBs, and I would argue that 99% of all problems found in the M5 originate here. On rare occasion does someone damage the pedal from inadvertent and extended exposure to an AC power supply instead of the proper 9V DC.
This cable assembly is formed by compressing a ribbon cable into self-aligning "forks" for each wire and relative pin/socket, an electrical connection is made as each fork pinches and breaks through the insulation and ultimately compressing the stranded wire for a connection. For whatever reason, during assembly some of these forks were forced open just enough to either break the insulation of an adjacent wire and make contact or not make an effective connection to its intended path. Just one short/break can short signals/power together, float critical connections, or create just enough resistance to render the unit short of reliable behavior. Any trauma, vibration or pressure to the pedal could exacerbate the issue resulting in failure.
To fix this from ever happening again, each tapered fork will need to be compressed together by hand (needle nose pliers) in such a way that both ensures clearance from adjacent wires and sufficient connection to it's intended wire.
If done with great precision the covers/locks for both ends of connector will reassemble with a bit of finess (overlapping each fork onto itself will increase its depth making it very difficult to fit into it's slot). If this is the case either correct each connection or cover all of in a generous bead of Automotive GOOP. This clear adhesive will effectively secure and isolate each fork and all but eliminate the chance of future shorts and breaks. In addition, this particular version of GOOP is remarkably robust while still leaving the option of being removed in the future without damaging the pieces it secures.
There's a notable amount of discussion addressing this and related power/audio issues in forums (and one particular youtube video) that claims the fix involves replacing the less conductive "painted" stock screws from the bottom of case with those that are more conductive. The truth is, there is little to no significant difference between the stock screws and bare copper. The stock screws are not painted at all, they're treated with a process which aesthetically turns them black with the added benefit of rust prevention. When measured with an Ohm meter you'll find no difference in resistance between old and new. Fundamentally, these mechanical connections are not critical to the pedals function at all, it will still work without the bottom cover.
Because the larger main PCB is secured by the front two screws the I/O jacks (which has resulted in a constant tension on the main PCB) removing the front screws will allow the PCB to straighten. The simple movement of the PCB, when swapping out the screws, is just enough to temporarily make or break the short (or at least increase the resistance) between the faulty connector crimps in the ribbon cable either making a correct connection or breaking an offensive circuit. Over time, use, vibration, trauma, transportation etc. this connection/break could eventually recur just enough to cause the same issue.
To fix it once and for all, address these connections properly and you'll never have the problem again! (FYI: One issue that is screw related is the mistake of using the longer screws from the front in the rear positions [typically after removing the rubber feet to allow more surface area for velcro adhesion on a pedal board] which will damage a decoupling capacitor and/or the PCB underneath each location. This won't necessarily brick the pedal, but will defeat an intentional component placement.)