BUG: groupby.agg with UDF changing pyarrow dtypes
Continuation of #58129

- [ ] closes #53030 (Replace xxxx with the GitHub issue number)
- [ ] closes #61636
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Root cause:
-  `agg_series` always forces output dtype to be the same as input dtype, but depending on the lambda, the output dtype can be different

Fix:
- replace all NA with nan
- convert the `results' to respective pyarrow extension array, using pyarrow library methods
- pyarrow library methods is used instead of `maybe_convert_object`, as `maybe_convert_object` does not check for NA, and forces dtype to float if NA is present (NA is not float in pyarrow),

This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. > as maybe_convert_object does not check for NA, and forces dtype to float if NA is present (NA is not float in pyarrow),

maybe_convert_object has a convert_to_nullable keyword.  if you pass that as True you'll get back a numpy-nullable array, which you can then convert to pyarrow.  Not sure if that is actually better than what you're doing here. The correct solution here and to several related issues is an EA._construct_with_inference method that behaves similarly to maybe_convert_objects but preserves dtype backend.  xref #56430.

(Felt the need to plug that, but doesn't need to be a blocker for this in the interim) thanks @rhshadrach  There are 2 issues listed in the OP but the check-boxes aren't checked.  I suspect that means they won't be auto-closed.  Should they be manually closed? Looks like they got closed.

Github only checks that a issue link follows a [set of keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to close that issue after a PR is merged, so it's not dependent on the check-boxes They were indeed meant to be closed.