I was a Fanuc service engineer many years ago.
The NMI error is a "Non Maskable Interrupt". This alarm will means that the CPU has been halted. The CPU is designed to "fail safe" and not let the servos run away and crash, so the NMI alarm shuts down the servos also. It's a pretty unusual event, and from my experience it rarely happens in the field.
Since you've replaced the boards, I think it's very unlikely that you have a HARDWARE problem on the boards. The likelyhood that you've have TWO boards with the same problem is astronomical.
With the boards ruled out, that leaves a SOFTWARE bug or an external event, such as ground faults or EMI (Electro Magnetic Interferrence), or possible a power supply problem.
The power supplies on these newer controls are "switching" type supplies, and they are pretty much immune to the stuff that used to affect the old style power supplies. They always have voltage sensing and overcurrent protection, so a bad power supply would likely just shut down rather than let the CNC run with poorly regulated DC power. It's still possible that you have a power supply problem, but personally I doubt it.
From your description, we can rule out software also, since a software bug or a corrupted executive program will malfunction in exactly the same way every time. You say that your problem "has no pattern". A software problem would pop up at the exact same point in the program, or whenever you tried to use a particular feature of the control. I'm sure you would have noticed a pattern like that.
Logically, that leaves us with an EXTERNAL event that's upsetting the applecart. A poorly grounded CNC control cabinet can leave the control vulnerable to EMI sources that are closeby. Are there any obvious EMI sources near this machine? I'm talking about anything that throws a spark, like an arc welder, spot welder, large motor starter, etc. If it's EMI, you may find that SOMETHING nearby is happening at the exact moment that the NMI alarm happens.
Ordinarilly, the CNC cabinet is supposed to be a good EMI shield, but that assumes that the cabinet is well grounded. Check to be sure there is a good ground stake very close to the CNC cabinet, and that a large diameter stranded wire connects the grounding lug in the control to the stake. Also check those little wires that ground the CNC cabinet doors to the rest of the cabinet. The hinges on the doors can't be relied upon to ground the door. Also check the cabinet door gaskets to be sure they have not been replaced with non-conductive rubber gaskets, like automotive weatherstripping. The original gaskets have a lot of carbon in the rubber, and they're conductive. And ... for God's sake .... DON'T run the machine with the doors open!.
Another possible cause is overheating of the control. Be sure your fans are running on the air-to-air heat exchanger on the CNC cabinet. A bad fan can cause lots of grief. There may also be some internal fans to circulate air within the cabinet.
If you have any welding equipment nearby, try running the machine for a while with all the welders shut down. If it fails anyway, then EMI from the welders are not the problem.