re-implement #27959
Previous version broke because a different branch changed the behavior of when extract_array is called.
Any idea why this wasn't caught by CI the first time around? > Any idea why this wasn't caught by CI the first time around?

Between the time when the #27959 went up and the time when it was merged, a different PR changed the expected inputs to `dispatch_to_extension_op`.  Previously `extract_array` was called inside `dispatch_to_extension_op`, but that was changed to expect the inputs to already be extracted.  27959 was calling using the older convention, which led to RecursionError.