added test case for iloc function if it returns the same output for b…
…oth numpy and pandas arrays to fix the issue #40933 

- [x] closes #40933 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry
