The last details clarified the use case and I just pushed a patch trying to fix. The issue was that only first group of destinations was considered to update r-uri/d-uri, but in your case that had no available destination address.
Try the master or the 5.2 applying the patch, if works fine, then I will backport to 5.2.