See https://github.com/bitcoin/bitcoin/pull/22762#issuecomment-951063826

This can be fixed by creating a new exception type and catching it in the right place.

#### Useful skills:

* C++ exceptions
* Addrman serialization
* Functional tests

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

{
    AssertLockHeld(cs);
    AddrInfo* addr_info = Find(addr);
    if (!addr_info) return std::nullopt;
    if(addr_info->fInTried) {
        int bucket{addr_info->GetTriedBucket(nKey, m_asmap)};
        return AddressPosition(true,
                               1,
                               bucket,
                               addr_info->GetBucketPosition(nKey, false, bucket));
    } else {
        int bucket{addr_info->GetNewBucket(nKey, m_asmap)};
        return AddressPosition(false,
                               addr_info->nRefCount,
                               bucket,
                               addr_info->GetBucketPosition(nKey, true, bucket));
    }
}
void AddrManImpl::Check() const