REF: move mixed-dtype frame_apply check outside of _reduce try/except
cc @jorisvandenbossche this is the same branch I linked the other day.  Some variant of #32867 may make this irrelevant, but I don't think getting this improvement in the interim will make that any more difficult.
I can't reproduce this test failure locally Maybe add a test specifically for the median of a dataframe with categorical columns, so it might be clearer what is wrong with that (as I suppose that is the reason that the `fillna(df.median()` is giving something else) btw I think we simply need to create pandas.core.reduce, similiar to how we have pandas.core.apply to handle all of this logic. much easier to reason about in a separate module (and can easily break down / dispatch cases).

 thanks, pls note potential followon above...