Currently, if team inheritance is enabled, setting $team through the UI or API is not allowed. It would be nice to enable 'Team inheritance' only if the $team value is not set explicitly during mapping.