BUG: handle multi-dimensional grouping better
As described in issue #36158 multi-dimensional groups prepared with lambda or named function raise error on indices as isnan() is not defined for MultiIndex.

Grouping already has the check for MultiIndex on line 440, but it's not triggered on __init__ when grouper is represented by **lambda** function and gets casted to MultiIndex later where MultiIndex stays as is.

~~Tested on the code provided in #36158, yet not sure if significant testing is needed as this is a relatively small change to code.  
Grouper code has not been changed for a while, should be save to merge.~~  
Tests for this particular issue provided.

~~**Concerns**: probably it will be better to make `isinstance(grouper, MultiIndex):` a function as after this change this piece of code occurs twice in __init__.~~  
Those operate on different grouper object. First one is passed on init, second one is `self`, where grouper is changed from lambda to MultiIndex and needs further change added in PR.

- [X] closes #36158
- [X] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
