The current way we sample from addresses within a bucket in addrman is randomized, but not perfectly random. It uses a linear scan, starting at a random position (out of the 64 positions in a bucket). This means that if for example only position 17 and 20 contain an address, 17 will be picked with probability 95.3% (whenever the initial position is 21..63 or 0..17) and 20 will be picked with probability 4.7% (whenever the initial position is 18..20).
Make this search perfectly uniform, regardless of distribution of addresses within the bucket, by first copying all non-empty positions to a temporary array, and then selecting uniformly randomly from that array.
Suggested by Crypt-iQ. Also pointed out earlier by mzumsande in #23140 (review).