It seems to me that it is not able to find the right IV to decrypt the right key. It decrypts half of the 8000.
If you're talking about each encrypted prvKey's IV, those should be the few bytes from the hash of their pair pubKeys
which are saved in the wallet where your addresses are derived from.
Since half of your private keys work but not the rest, you can assume that the AES Key is correctly decrypted from the Mkey and the provided wallet passphrase.
Because the same wallet.dat wont save two of it to encrypt separate set of private keys.
So the decryption process and the passphrase shouldn't be wrong.
I'm thinking that it could be a case of corruption or interrupted encryption process rather than a bug,
assuming that the rest of the wallet's encrypted keys are somehow corrupted or "
other reasons" that could mismatch their public keys or make the master key unable to decrypt them.
Some background details about the wallet should help a bit.
e.g.: when its created, which versions have your used, something happened to it, is it recovered, from a friend? etc.
I see similar problems Googleing and some have sucessfully fixed the problem downgrading Bitcoin Core.
Can you share those threads for reference to see if it's related.