ApiEditPage sets $wgRequest to the API request when being executed, but it doesn't update RequestContext::getMain()->getRequest().
As a result of this, when code in FlaggedRevs was updated to use RequestContext::getMain()->getRequest() instead of $wgRequest in c58febaa602036d64f05ae1f831fe08caf321d97, it broke the "Review pending changes" checkbox when using VisualEditor (T426539), as VE uses a DerivativeRequest to call action=edit internally when an edit is submitted.
A fix for this was attempted in 4675b694527ee5de30775c584d2858564a46c544, which updated ApiEditPage to set the main request to the API request as well, but it had to be reverted because it caused T426751: Stuck in FancyCaptcha challenge loop on VisualEditor. ConfirmEdit (and potentially other extensions) should be fixed so they don't rely on this discrepancy anymore.