removeByRankRange - not working with reverse rank as expected

I would love it if someone can address this issue i’m having:

I’ve solved it, wrote the solution as an answer in stackoverflow