Minecraft won't work on my Xbox One, even after I bought it. Can someone

So around two weeks ago, I ordered the digital copy of Minecraft off of amazon, straight to my Xbox. (If you don't know how it works, you pay, and are given a code, you then enter the code into your Xbox and you've bought Minecraft! Or at least, that's how it's supposed to work.) So instead of entering the code on my Xbox, there was an option where I could start the download from my computer. So when I entered in the code, it said it was downloading. So I went to my Xbox and realized that the game had not yet downloaded. When I tried to enter the code again on my Xbox, it said it had already been taken (because I had entered it in on my computer). So I was really disappointed and confused that I had wasted my money.
Flash forward to a week later, I was getting on my Xbox, and I thought, "Hey, I'll try this one more time." And it worked! I could play Minecraft, and I did so for about five hours. I was super pumped, and just assumed that it took time to download.
Flash forward even more to last night. I was going to play with a friend on a survival world, and when I tried to play, it said "Continue your free trial". Now, I had downloaded the free trial a while back, before I had ordered the digital copy of the game. Confused, I tried to open the game a million different ways and every time, it would tell my that I was playing the tutorial. So I don't know what to do.
Also, my Xbox was being really strange. As soon as I would log in, it would log me back out again.

It sounds like you only ordered a free trial when it was active. A lot of games do that from time to time. Right now, Overwatch and Fallout 4 are free to play this weekend. After this weekend, you're locked out of it until you buy the digital copy.

go to your account on xbox.com, and look at your purchases history. See if you actually purchased Minecraft. If you don't see it there, it was likely a free trial play.

if you need future assistance, just call Xbox support. 800-469-9269