I rebuilt my system, exactly as I had it before. I tried my custom component (both round and trunc) and it works now (although it takes a long time to compute). I have no idea why. This software can be very fickle.
But anyway, I did have a revolute joint. Instead of measuring the angle from 0-360, I wanted to measure from 0-180, then -180 to 0 again. It's an inverted pendulum model, so I wanted displacements from the vertical to be opposite sign for opposite direction (-2 degrees opposed to 358 degrees). I'm including this precision limit, as well as a unit delay, to incorporate the effects of sensor precision and microcontroller calculation time, to determine which components are needed.