What happens to a spent Bitcoin that was earned from a chain replaced by a longer chain? Let's say miner Moe mines a block taht is accepted by the network.  Moe presumably receives some Bitcoins in his wallet for this.  So let's say Moe "spends" that Bitcoin by buying some anti-poking goggles from Curly, even though his newly mined block is at the top of the chain and has no blocks on top of it.  Curly sends the goggles to Moe via FedEx.  Then another miner Larry mines a longer block and that replaces the original one Moe mined.  So now Larry has some Bitcoins.  So does the transaction between Moe and Curly disappear and Curly is left without a pair of goggles and with no Bitcoin?
Yes, Moe's transactions (both the coin creation one and the payment transaction) become invalid if Larry mines a conflicting blockchain that has more work (almost the same as longest, but not quite) than Moe's blockchain. So Curly would be without payment and Moe would have gotten himself a free pair of goggles.

Now if Moe and Larry were the same person this would be a Finney attack where Moe/Larry are intentionally defrauding Curly.

Of course there are built in safeguards to protect against this. Firstly, Moe cannot spend newly mined Bitcoins until 100 blocks have been mined on top of his block. But even if he did wait 100 blocks before transacting, Curly could still be defrauded.

The solution to this is for Curly to wait for the payment transaction to get a few confirmations. By waiting for confirmations, the amount of hashrate that Larry would need in order to change the blockchain to not include Moe's transaction greatly increases. After a few blocks, it is basically infeasible and thus it can be said that the transaction is permanent and cannot disappear.