Fix mypy error message in `pandas/tests/indexes/test_numeric.py` …
Use Optional to signal that the value may be either an `Index` or `None`.

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

You'll have to rerun the CI. Tests passed, rebasing on top of `master` squashing my fixup...

P.S. Thanks for the label, completely forgot about it! 😃  @GrigoriosGiann Thanks for the PR. This partly overlaps with #28961. will revisit this once #28961 merged. overlaps with #28961