Team Fortress 2 is not free on Xbox — and it never was. The game launched exclusively as part of The Orange Box (2007) for Xbox 360, a $59.99 retail bundle that included Half-Life 2, Episode One, Episode Two, and Portal. Unlike its PC counterpart, which transitioned to free-to-play in June 2011, the console version never received that update.
Recommendation: Play on PC or Steam Deck. It's free, current, and the definitive version. The console versions are abandoned 2007 snapshots with no support, no updates, and no players.