Regrettably, i don't think it's even worth solving, because this is not the right board for a 5900X. Please note that the CPU compatibility that MSI state is only about the BIOS (or more specifically, the AGESA in the BIOS, i.e. the BIOS having the right microcode available for this CPU model). It does not say anything about the practicability of putting certain CPUs into this board. The A320M-A PRO MAX is an extremely budget, entry-level board model, with a very weak VRM - only three CPU VRM phases made up of cheap discrete MOSFETs - and no VRM heatsinks. So it would be unwise to put something like a 3900X/3950X or 5900X/5950X on there, even though they are "compatible". It would completely overwhelm the VRM.
When getting a 5900X, i would assume that you want to use its impressive multithreaded performance sometime. For example, you have things to encode or to process, causing prolonged fully multithreaded load. You will definitely get throttling, either CPU or VRM throttling or both, probably even a shutdown from some board protection. But at the very least, decreased performance from having to clock lower.
The A3xx/5xx boards can be completely disregarded for a high-end CPU, as they are very cut-down in features and component quality, only suitable for entry-level CPU models and very humble needs. The higher the CPU model, the more current it draws, and the higher the transient load, meaning it can suddenly draw lots of power. And under sustained full load, the VRM has to be up to the task and not be too inefficient and overheat.
If you want a proper µATX board for the 5900X, forget all the A320M/A520M models and look at the MSI MAG B550M Mortar (WIFI). It's pretty much the only microATX-sized AMD board from MSI that uses powerstages for its VRM and is therefore suitable. Heck, even the most entry-level X570 boards are not really suited for the highest-end CPUs,
read here for example. And that board is better than yours already (one more CPU VRM phase and VRM heatsinks), but still too weak/cheap components.
Hopefully your CPU cooler and PSU are of a higher caliber than your board, otherwise you might run into some more problems. You can tell me the models if you want, then i can tell you about that.
Maybe the PSU even has a part in this problem you have. But once you solve that, the next problem would be the board under CPU load.