The $entity->toUrl('canonical') == $url
check in RabitHoleLinksGenerator was returning false, and so the removing of the link was never happening.
The only difference was that for the canonical result the accessManager was false and for the $url variable "accessManager =
Drupal\Core\Access\AccessManager"
Active
1.0
Code