“Fried” is a pretty broad term and really covers any potential failure mode that doesn’t end up running the motor - having a failure on two controllers WITH visible damage to the encoder board and the casing is your big clue. Sinking 30-40 amps into one of those things in a failure mode is going to almost certainly toast something in an obvious way (assuming you didn’t look inside and see obvious damage).
The encoder connections are out of the high current path so the circuit breaker probably won’t help you there but the fact that you see damage there is telling you, screaming at you, to look at the wiring connected to the encoder board.
It sure seems like the source of the issue is there…
Keep in mind that the breaker doesn’t trip instantly at 40A (or 30A or 20A), there is a time factor here as well, but in general, the high current paths in these controllers are good for many times the typical breaker current when used to operate the motors.
My suspicion is that you’re damaging something in the motor control controlling circuits which is killing it. I’d take a really, really, really careful look, with multiple people looking at it, before I’d toss another controller at the problem. Look at every connection, look at the wiring diagram for the encoder board, look at the wiring diagram for the encoder you are using, check for mis-wiring or stray strands between connections, check polarities, everything - assume that anything not extensively checked out is unverified, and potentially wrong.
You’ll find it, it’s out there, but you may need to wipe out your assumptions and make sure you’re not seeing what you thought you did but what you actually did. It’s incredibly useful to bring in someone skilled in this area but who did not wire this so that they bring fresh eyes to the problem.
This is like proof reading your own papers; it’s really hard to do. You don’t read what you wrote, you read what you thought you wrote. Someone new actually reads the words and then asks “What is this supposed to mean?” You get embarrassed because you never thought you’d write that but in reality you did - the other person found it and now you can fix it and make it better.
Those kinds of things happen to all of us - it’s not because we’re not smart enough, I think it’s because we get too smart, too confident, and lose some of that attention to detail - we’re not scared anymore like we were when we first did something and super double, triple, mega checked things out as we were doing it. That’s when you make a silly mistake - silly mistakes can definitely fry things and if we don’t stop to think about what just happened, we plug another one in an the same things happens - “Hey, both of these must have been defective! Gimme another one!”
Suspect everything connected to that controller and step through it all - the problem is likely there in front of you.