This is a bug I've experienced in FE7CM, and in Min-Max Emblem. I already know how it works, but I'm posting this topic so others know. Also, so I don't have to look up my posts on the FEU Discord constantly to reference it.
Simply put, if you add classes past the final class in FE8 (0x81?), the game has several bugs, but the biggest and worst one involves characters gaining tons of RES. This applies to ally and enemy units.
So the stats randomly bug out, right? Wrong. It's entirely based on deployment order, for allies and enemies.
Red units affected, green units unaffected. (Normal RES.)
That's all we know. Kirb's current system for expanding the class array does not solve the problem. I believe he's working on a fix still.
@AlfredKamon mentioned @Brendor managed to expand the class array and apply a new save system for Midnight Sun several years back and no bugs were reported. Maybe he knows something?
Anyway, this is the biggest bug. Don't expand your class array until it's fixed. That is all.