Upgrade 8.0.3 -> 9.0.1 upgrade fails 'Exception: Invalid link team_link'


We are currently upgrading one instance from 8.0.3 to 9.0.1. and are running into a strange issue. When the upgrade is done and the after upgrade scripts are running we get the following error in the ugprade wizard log:

Mon, 09 Sep 2019 16:57:05 +0200 [Upgrader] - Start rebuilding relationships
Mon, 09 Sep 2019 16:57:17 +0200 [Upgrader] - ERROR: Exception: Invalid link team_link
Mon, 09 Sep 2019 16:57:17 +0200 [Upgrader] - Finished script 2_Rebuild
Mon, 09 Sep 2019 16:57:17 +0200 [Upgrader] - ERROR: Post-upgrade stage failed!

as you can see the rebuild reports a team_link error but it does not report where this error occurs. IF we check the logs of the server we do not see any strange things that lead to the possible location. Also the post upgrade stage failed message is something that worries me.

did someone see this behaviour? Can someone point me to the right direction where to go look for a possible cause? What we do see when we open the application after the upgrade failed is that lots of queries are failing that are using the outboundmail module. This module is not touched by any customization??