In the fix of bug 24185, (commit 18ad5f5eea8aab8414783f4b75408cfebd2518da) bibliotemnumber is used where biblionumber is required. The consequence is that ItemsAnyAvailableAndNotRestricted is called on the wrong record.
biblioitemnumber and biblionumber must be contain the same value. If not you are going to face some oddities.
There is nothing enforcing the sameness of these two identifiers and they typically are not the same on any of our installations. (If the relationship between biblio and biblioitem is one-to-one I think that biblioitemnumber should be removed as it only provokes this type of coding errors.)
The relationship is 1:1 in modern Koha, but it didn't use to be. The change is not so easy overall, but it has been discussed to merge tables many times I think. I am not sure why they are not the same in your dbs - they are in ours. It means, sometime they must have gotten out of sync.
Bug 26518 - it is quite easy to get these numbers out of sync
I think we can safely de-escalate this one.. bug 26518 goes a long way to preventing the fields from getting out of sync and we can continue working on removing biblioitemnumber entirely in due course.
*** This bug has been marked as a duplicate of bug 28057 ***