A post object field stores a post ID. So, the $value of the field needs to be the related post object id and $post_id is the post you are updating. This is why I’m asking what the value of $team_code is.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users