For anyone having EMI issues I highly encourage you to read this manual from Allen-Bradley cover-to-cover.
https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/gmc-rm001_-en-p.pdf
After reading it, I changed a few things in my panel and it has been rock solid ever since. Here were my biggest lessons.
1) I use MeanWell DR-120-24 which has a metal case. The case is grounded via the din rail to the enclosure star point. What I did not know is that the DC - terminal is tied to the ground internally so when I tied my DC- Bus to Earth ground I established multiple ground loops. Goes without saying that your PSU may be differently wired but if issues persist worth checking.
2) Classify power carrying wires as dirty or clean. Doesn't matter if they carry AC or DC, high voltage or low if they are dirty they are dirty, and need to be physically separated (industry standard is ~6" free air space) or shielded from the clean ones. I don't have, nor want, a large enough panel to leave 6" of space and the thought of rewiring with heavy gauge shielded wires was a non-starter. So I installed these nifty wire tray shields made by Panduit. They provide the same effective air space without any actual space!
3) All switching PSUs (99% of the DIN rail ones we all use) generate a ton of noise by nature. Most have some basic filter on the output to eliminate +90% but some will slip through along with any induced noise along the wire run. Treat these wires as dirty and use a second filter to generate clean DC power for sensitive electronics (MEGA and sensors) and use the unfiltered side for everything else. This includes devices such as relays, solenoids, contactors and pumps even if flyback diodes, RC Snubbers etc are installed.
I think this third point is REALLY solid. There is no doubt in my mind this is where most noise problems come from. Do you have any recommended inline noise filters?