BUG: coercing of bools in groupby transform
This bug is  happening because of the following lines of code(3054-3059 in groupby.py)
```      
       # we will only try to coerce the result type if
       # we have a numeric dtype, as these are *always* udfs
       # the cython take a different path (and casting)
       dtype = self._selected_obj.dtype
       if is_numeric_dtype(dtype):
           result = maybe_downcast_to_dtype(result, dtype)
```
the call to `maybe_downcast_to_dtype` successfully downcasts bool to float thus the result is 1.0.
I've put a guard in place to check if the result is boolean. This seems like an optimal solution, to me, since the behaviour of `maybe_downcast_to_dtype` seems consistent.

Fix inconsistency in groupby tranformations

 - [ ] closes #16875 
 - [ ] tests added / passed
 - [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
 - [ ] whatsnew entry
