One of my electrical engineering teachers goes by the idea “The magic smoke is what makes electronics work. You can usually let out a little bit of it, but if you let too much out your circuit won’t work anymore”. I was told that right after someone gave me the wrong schematic and a 555 timer IC literally split itself in half when I turned on the power.
Is that a real Arduino Mega or a knock off? The knock offs use terribly cheap regulators that can’t handle much deviation.
At least is is probably an easy fix if you can get the regulators cheap enough.