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
