TST: add test case of ngroup with NaN value
- [x] closes #50100
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests).
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added new tests to `GroupBy.ngroup` method, which ensure consistency returning a 0 value.

Thanks @josemayer 