As @Proc has pointed out to me on IRC, it seems EditResult's revert-related fields are not set correctly when using the undoafter URL parameter. Weirdly enough, if one tries to revert just one revision (so undoafter is set to be the second-to-last revision) it works fine. The problem only occurs when the undo spans multiple edits.
There's some strange magic going, I'll try to fix it ASAP.