BUG: Bug in quantile() and median() returned wrong result for non monotonic window borders
- [x] closes #37153
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

cc @mroeschke 

Values were not added to the window again if starting point was moved back and values were not removed from the window, when ending point was moved back

Should I create functions for the deletion and addition?