BUG:Sanity check on merge parameters for correct exception #26824
- [x] closes #26824
- [x] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry