Almost certainly that means that one of the other Civs has completed the same Great Wonder first, and there can only be one of each. There should have been a message pop up to tell you "The American city of Dullsville has completed the Great Donut" or something like that
Then you should get the domestic advisor (I think) telling you that your city of Dullburg can no longer work on the Great Donut and production has been switched to the Mildly Interesting Tower.
The only other way is if your Civ has lost one of the preconditions for the Wonder - AFAIK the only Great Wonder with a precondition that can be lost is The Manhattan Project, which needs the resource Uranium. If some other civ captured your Uranium, you couldn't start the Manhattan Project - although if you had already started it then I *think* you might be allowed to finish it.
Quite a few of the small wonders (the ones everyone can build one of) DO have prerequisites that can be lost, though.
As to what you are doing wrong: not much. If the AI starts to build before you, and/or in a city with more shields per turn than your city, then it can beat you to the wonder. The only solutions are:
1. Use a great leader to 'rush' the wonder - building it in 1 turn.
2. Be ahead in tech and start the wonders first, in your biggest cities, so you finish faster
3. Attack or sabotage the enemy cities building the wonder. A drastic response really.
4. You can 'prebuild' a wonder if you plan ahead. If you want to build The Great Library, say, and your research will finish in 10 turns, start to build something expensive now, in a big city, so that it will take more than 10 turns to finish. Then swap the production when you finally get the ability to build the wonder. You'll get a head start - the AI doesn't do this AFAIK. But DON'T rush the other thing with gold or cut-down forests - if you do then it won't let you switch.
If you put some relevant terms into the 'search' function you should get a pile of advice about wonders - a lot of it better than this, too!
