Do you own it or did you play it from Game Pass?
If you played it from Gamepass, when it gets removed from the service, it automatically changes to "no longer have" in your game collection.
If you own it you can manually change it to owned from game collection page by opening view and filter then unchecking the exclude not owned box.
Then use the edit button on far right of page to change to owned and it should show up.